All posts tagged smtp

MX Records, FQDNs, Host Names and Dots

It seems that something as critical as email for the business environment should be protected at all costs, and that too goes for making any changes to said email servers.  Especially when the nature of email is that it can take up to 48 hours for any mistakes you make to a internet facing infrastructure to propagate themselves out.  So knowing what you are doing is vital.

Continue reading →

Saving Bandwidth the Postfix Way

I often work with smaller organisations make their IT run smarter and better and allow them to save money.  An on running theme I’ve come across for the last couple of years is internet speeds.

For instance one company I’ve worked with is the parent company for 4 other organisation, they run some centralised services from their head office location which all the other companies connect to over a business DSL service with a VPN ontop.  Each company also runs it’s own mail server on their own network.

Continue reading →

How to fix Mail Loops Back to Myself

Everytime I’ve come across Postfix, Qmail or Exim (or some derivative thereof) complaining that “Mail Loops Back to Myself” it’s always been the same thing.

If the next hop of an SMTP conversation the next relay step responds with the same mailname or hostname as the initial server it thinks it’s talking to itself.

In my humble opinion a better (and clearer) mail message would be “I appear to be sending email to myself and that will cause a loop, so instead I’m sending you the email back before I break myself”.

Continue reading →

Spammers Ignore MX Records

We recently changed our SMTP mail routing via our MX records to point a hosted email service after running our own inhouse email filtering for the last few years.

We changed the MX records, updated the rules on our firewall to route from our email service providers servers to our own Exchange servers and after the usual 48 hours for these things to propagate across we signed it off as a project complete.

6 months later we came to investigate a mail routing issue, and on checking the firewall logs we were still seeing traffic directly hitting the IP address of our old MX records hosted in our DMZ.  Strange we thought, so we plugged in Posfix to talk SMTP on this IP address just to see what was happening.

Funnily enough all the email that was coming through was blocked by RBLs so we can say that a change in MX records will not necessarily protect you from spammers who try to use old SMTP and MX details to push their email to you.  This is why a DMZ and a proper granular firewall policy makes them oh so much worth while.  So don’t trust MX records to protect your Exchange or other MDA enviornment from junk mail.

A God way to Change MX Records

Email is critical to a business, and it’s continued flow is paramount.

When changing MX records (for example a company aquisition or the purchase of an email filtering solution) you should always be careful not to break anything.  A lot of systems use MX records as a way to check spam mail, and if they don’t work you may have problems sending and receiving emails.

A way we discovered to make sure you don’t break email goes along the following which although takes eight calendar days in which to implement fully, it is a belt and braces approach and is definitely safe.

Assume you’ve just bought a hosted email security service and they have given you the servers mx1.emailprovider.com and mx2.emailprovider.com to change your own records to.

Day 1 MX Records

mx1.companya.com = 111.222.333.111

mx2.companya.com = 111.222.333.112

MX preference = 10, mail exhanger = mx1

MX preference = 10, mail exchanger = mx2

Day Two MX Records

mx1.companya.com = 111.222.111.111

mx2.companya.com = 111.222.111.112

mx1.emailprovider.com = 222.111.111.111

mx2.emailprovider.com = 222.111.111.112

MX preference = 10, mail exhanger = mx1

MX preference = 10, mail exchanger = mx2

MX preference = 20, mail exchanger = mx1.emailprovider.com.

MX preference = 20, mail exchanger = mx2.emailprovider.com.

Day Four (Yes Day Four) MX Records

mx1.companya.com = 111.222.111.111

mx2.companya.com = 111.222.111.112

mx1.emailprovider.com = 222.111.111.111

mx2.emailprovider.com = 222.111.111.112

MX preference = 10, mail exhanger = mx1

MX preference = 10, mail exchanger = mx2

MX preference = 10, mail exchanger = mx1.emailprovider.com.

MX preference = 10, mail exchanger = mx2.emailprovider.com.

Day Six (Day Six) MX Records

mx1.companya.com = 111.222.111.111

mx2.companya.com = 111.222.111.112

mx1.emailprovider.com = 222.111.111.111

mx2.emailprovider.com = 222.111.111.112

MX preference = 10, mail exchanger = mx1.emailprovider.com.

MX preference = 10, mail exchanger = mx2.emailprovider.com.

MX preference = 100, mail exhanger = mx1

MX preference = 100, mail exchanger = mx2

Day Eight MX Records

mx1.companya.com = 111.222.111.111

mx2.companya.com = 111.222.111.112

mx1.emailprovider.com = 222.111.111.111

mx2.emailprovider.com = 222.111.111.112

MX preference = 10, mail exchanger = mx1.emailprovider.com.

MX preference = 10, mail exchanger = mx2.emailprovider.com.

MX preference = 100, mail exhanger = mx1 Deleted

MX preference = 100, mail exchanger = mx2 Deleted

Don’t forget to update your firewall rules accordingly.