I am in charge of setting up our company email infrastructure and have a question on how to setup redundant pop/IMAP servers. I understand that I can setup failover for inbound email using MX records but how do you setup the same type of thing for email retrieval? If our mail server goes down I don't want to have to go to every computer and change the email settings.
POP/IMAP uses A records for DNS? If so, would the solution be to manually change the A record to point to the backup mail server if the primary server went offline?
Any thoughts or suggestions would be greatly appreciated.
Switching the DNS record is by far the simplest and least invasive way of doing what you want to acheive, but be aware that it's not foolproof. Depending on how well behaved the clients DNS is, it may cache old records for an extended period of time.
If a bit of downtime is acceptable, then set your
TTL
of yourA
record to a small value (say, 5-10 minutes). In the even of a failure, most of your users should be back online within 10 minutes.If you want to provide more redundancy than this, then you need to decide what sort of failure you're trying to mitigate - server failure, or connectivity failure?
Server failure is fairly straight forward - use a load balancer (it needs to be a Layer 4 load balancer. A lot of load balancer are Layer 7 and inspect the inbound traffic, this is not really nessesary for something as simple as this). to redirect requests to one server, until that server goes offline, then redirect them to another. So the load balancer will own the public IP address, and it then takes care of the communications. Or, you set up a heartbeat between the two servers, they both have configs for the same IP address, but only one of them owns it at any given time. In the event of a heartbeat failure, the 2nd server takes over the IP address and starts serving requests.
If you want to mitigate connectivity failure (i.e. a failure of your inbound connection) and fall over to a remote site, that's far too complicated for a simple answer here.