I often have to migrate mailservers therefore it’s important for me to have a tool like imapsync.
Imapsync, as the name suggests, is used to sync a source and a destination imap mailbox. It’s highly customizable and can be scripted using the powerful command line interface.
I don’t want to write a full tutorial (see here, here or here) but instead give you a short overview.
Requirements
- Perl
- Mail::IMAPClient (get it using cpan or direct download)
- imapsync
Simple usage overview
imapsync --host1 imap.truc.org --user1 foo --password1 secret1 --host2 imap.trac.org --user2 bar --password2 secret2
For further information see the man page.
Problems
This is the most important part of this posting. Here I will list problems that I encountered.
imapsync quits in the middle of a synchronization
This is most likely caused by a broken Mail::IMAPClient library. Try to download a (newer) version here and include it using perl’s “-I” command line parameter
“xx BAD Command Argument Error. 11” is printed
I had this problem once using an Exchange 2011 as the destination. It means that the current message exceeds the maximum message size. See this post for how to fix it.