Migrating Emails from One IMAP Provider to Another
I have finally tired of mailsnare’s poor customer service. For a long while, the only way to get a response to a ticket was to post on the forums and publicly shame them into responding. Then they deleted the forums.
After trying several candidates, I have finally settled on webmail.us.
There are IMAP providers out there offering more bells and whistles but webmail.us advertises 99.99% uptime and offers 24 hour support by email, web or phone. With that kind of service, I can live without cutting edge, alpha-geek features that aren’t much use when the email server has been down for three days and no one is responding to requests for service…
Migrating several years worth of email from one imap provider to another has proved a little trickier than expected.
The low-tech solution is to set up Thunderbird to check both accounts and drag messages from one to the other. Unfortunately you cannot create folders on dragging which makes it necessary to manually create all target folders. Moreover, if you interupt the copy process (for example by opening another folder) then it is aborted and not all messages will be copied across. This grows old very quickly.
Enter imapsync to the rescue.
Syncing the two accounts over ssl is as simple as:
imapsync --host1 mail.mailserver1.com --user1 username1 --password1 secret1 --host2 mail.mailserver2.com --user2 username 2 --password2 secret2 --ssl1 --ssl2
All necessary folders are created in the second account and flags and datestamps are preserved. The man pages are very comprehensive and deserve close reading.
Debian Etch contains the package by default and apt-get will handle all the perl dependencies. (Etch also includes a similar tool imapcopy which looks promising but I have yet to try it.) Users of other distros - or operating systems - should try the imapsync project page.
Edit - I did run into a problem with messages being copied more than once on subsequent reruns of imapsync.
This was easily solved by following the advice in the FAQ. Some IMAP servers add headers for each message transfered so each time you run the process, imapsync thinks all the messages are new. Rather than dig through the headers to work out exactly where this was happening, I took the lazy option and instructed imapsync to just use the Message-ID header when comparing messages and to ignore any size changes.
imapsync ... --useheader 'Message-ID' --skipsize
Voila. Four and half years worth of email effortlessly transfered from one IMAP account to another.