Oct 02 2016

Microsoft Exchange Multiple Mail Relays

Published by at 10:12 pm under Exchange




This works for Exchange 2003, 2007, 2010 and 2013. Haven’t tested on 2016 but it should. Please let me know if you do.
 
You have an Exchange server (or cluster) that communicates to the outside through a mail relay (also called smarthost), usually in the DMZ. You’d now like to double the infrastructure on a second site – siteB – in case something goes wrong on site A, meaning a relay on each site, with their own Internet connection.
 
Routing incoming mail is only a matter of creating DNS MX records for each mail relay and forwarding mail to Exchange servers. External mail servers will automatically fall back to the second mail relay if the first goes down.
 
Routing mail to the outside can be a bit more complicated.
If you add a 2nd mail relay to the Exchange send connector, it will load balance emails over the 2 relays wether they’re up or not, and will not fail over. But there is a way.
 
Create DNS entries for relays, each in his own subdomain:
SiteA: RelayA.siteA.mydomain.com
SiteB: RelayB.siteB.mydomain.com
These could be aliases indeed pointing to real hostnames.
 
Create 2 MX records for siteA subdomain, the local relay having the lowest number (highest priority):

siteA.mydomain.com.	3600	IN	MX	5  relayA.siteA.mydomain.com.
siteA.mydomain.com.	3600	IN	MX	10 relayB.siteB.mydomain.com.

Do the same for siteB if there’s also an Exchange server on the site.
 
All you need to do is to create a send connector pointing to siteA.mydomain.com. Before resolving the DNS hostname, Exchange will first attempt to do an MX lookup, even though this is not clearly stated in Exchange EAC.
 

 
With this flexible solution, you have loads of possible setups. You could:
– Send traffic to the local relay and fail over to the remote site
– Load balance the traffic on the 2 sites and fail over if one goes down (same MX priority)
– Load balance the traffic on 2 local mail relays and failover to a single remote (two equal high priority MX and a lower for the remote relay)
And so on
All is fully automated if a relay becomes unreachable and new relay hosts are managed through DNS. Simple, really


No responses yet

Trackback URI | Comments RSS

Leave a Reply