2

I plan on moving some WHM/cpanel accounts to a new server, I am under the impression that during transition, some emails might land on old server even if the files have already been copied to the new server.

Is it possible to prevent this so that all incoming emails during the transition won't get lost?

Hennes
  • 65,804
  • 7
  • 115
  • 169
IMB
  • 5,583

2 Answers2

5

Ok, this is fairly straightforward from your comments.

  1. Change your A and MX records for the email server TTL to something small - 60 seconds
  2. Wait until the current TTL has expired, and so everyone is using the new 60 second TTL
  3. Shutdown exim
  4. Full backup on current server, full restore on new server
  5. Change DNS records, and restore TTL to sensible value

Because you have reduced TTL, your outage Window is a long as it takes you to backup/restore the files and change DNS.

Paul
  • 61,193
0

Another method (if any downtime at all is absolutely unacceptable to you), is to use Postfix or similar as basically a delayed relay.

You could start a server as a relay, and then configure the scan threshold to be something very high (and keep expanding it if your maintenance window grows, which they often do :p ). Alternatively, you could firewall-block any outbound relay/send attempts in such a way the Postfix (or whatever) would requeue the messages.

Network/DNS wise, you'd set up a relaying/delaying server as mentioned above, point your old MX record to it (with the TTL reduction as mentioned by @Paul), conduct your maintenance, point the MX record back where it should go, change the relayhost in Postfix to point to that record (it might get annoyed because it thinks it's pointing to itself, in which case you'd need a second temporary MX), and let it process the queue.

That was a bit fragmented as an explanation. For more information, check out this ServerFault question and this how-to. That should get you on the right path.

Then again, if a little bit of downtime is acceptable to you, @Paul's solution is much simpler.

Zac B
  • 2,903
  • 4
  • 27
  • 39