Mar 092012

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 herehere or here) but instead give you a short overview.


Simple usage overview

imapsync --host1 --user1 foo --password1 secret1 --host2 --user2 bar --password2 secret2

For further information see the man page.


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.

  5 Responses to “imapsync: Migrating imap mailboxes”

  1. Having ran into this issue myself. One thing to note is if your exchange cluster is DAG enabled then you need to make sure that the transport config dumpster size is set to an appropriate amount (1.5x the max message size).

  2. A better magazine theme would make the blog nicer.:)

  3. Hello Florian,

    Thanks for this post.

    Happy users can also thank this author by giving him a book
    or by buying imapsync at

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>