I recently took it upon myself to migrate dozens of email accounts off of a legacy server I was paying way too much for, and move over everything to MXRoute. $30 USD/year is a pretty good deal for unlimited mailboxes and ~400 sends per hour from each box. I looked into Migadu and setup an account, but the limitation on sending is the issue I have with their service, so MXRoute was the way forward.
But, in migrating emails, you have to migrate the emails!
Step 0.5: Take your TTLs down!
A day or two before migration, take the TTL on your old DNS down to a minimum in order to encourage a quick propogation.
Step One: Create the New mailbox on the New mail provider
You will want an account to exist that you can sync the mail to, so let's say you are migrating josh@joshblais.com - you will have the old host with that email (still active) and on your new host, you will create a mailbox for josh@joshblais.com (currently inactive)
Step Two: imapsync
I found imapsync for this very purpose, and it was fairly straight forward: just install it with your package manager, and put your password for the account in a /tmp /
file so it can be read:
echo "AccountPassword" > /tmp/pass
Then run:
imapsync \
--host1 imap.yourOLDEMAILHOST.com \
--user1 email@email.com \
--passfile1 /tmp/pass \
--host2 impa.yourNEWEMAILHOST.com \
--user2 email@email.com \
--passfile2 /tmp/pass \
--ssl1 --ssl2 \
--dry --justfolders
to test the migration. If everything is good, remove --dry --justfolders
and run it for real.
Then, shred
your password file and delete your shell history so as not to expose your password.
The folders and mail will be synchronized across the accounts.
Step Three: Migrate DNS Settings
Then, and only then should you update your DNS records to point to the new email server. Leave your old server active for a few days to catch anything that may not see the DNS propogation, and you will be set!
As always, God bless, and until next time.
If you enjoyed this post, consider supporting my work by Buying me a Coffee, Checking out my book, or sending me an email to tell me what you think.