The most efficient way to sync IMAP mailboxs

Hey folks,

Recently, I had some domains from an old to a new provider. Unfortunately I had attached emails to those domains and I wanted to keep track of my email history such as email sent, email received and so on.

Basically, what's going on when you change your domain provider and it has email related ? You'll end up with two exact email adress, let say:

myemail@example.com imap.server1.co
myemail@example.com imap.server2.co

If your DNS are already updated all new email will come to the new email adress inbox and the contrary if it's not the case. Anyway you'll have first to update your DNS when your domain is transfered and you'll start receiving and sending mail from the new one. However all of your history will not be forwarded. I've look at multiple solution to forward/copy/export-import your old data to the new server. Some were client-side based (thunderbird) with some extensions or third party services such as:

  • Thunderbird add-ons ImportExportTools NG available from here
  • OVH has also on option of doing this here the problem is that I'm not that much confident of giving my credentials through a third party program

None of the solution above were fiting my needs. Nevertheless I stumble onto IMAPSYNC a very well written tool for achieving this.

Official website:

Official imapsync migration tool ( release 1.977 )
Imapsync is an IMAP sync tool. It syncs all folders from one mailbox to another, both anywhere on the Internet or in your local network.

Github:

imapsync/imapsync
Imapsync is an IMAP transfers tool. The purpose of imapsync is to migrate IMAP accounts or to backup IMAP accounts. IMAP is one of the three current standard protocols to access mailboxes, the two ...

It also have a online solution available from: https://imapsync.lamiral.info/X/, however same as OVH's solution can't deal with that where futhermore it has also some limitation.

So you can buy imapsync with support right from the website here: https://imapsync.lamiral.info/#buy_all

But you can also run it yourself locally with docker, actually there is a docker image maintained here: https://hub.docker.com/r/gilleslamiral/imapsync/

Usage is pretty straighforward it works out of the box the same way as if you had the imapsync cli installed on your comp.

Let say you want to migrate an adress you can do so that way:

docker run gilleslamiral/imapsync imapsync \
   --host1 old_server --user1 email_address --password1 password_value \
   --host2 new_server --user2 email_address --password2 password_value

This will litterraly sync your 2 email from `old_server` to `new_server`.

I managed to sync a bunch of email adress without any issue the tools works pretty well. Big thanks to the author @gilleslamiral for his devotion and work for that tool. Ouf of the simplicity of his tool, to be honest I had no idea it was such a pain in 2020 to achieve this kind of thing of just migrating mail data between 2 different server. Now with IMAPSYNC you know how to make it, the right way.