Transferring lots of messages between IMAP accounts

IMAPSync is the tool your looking for. IMAPSync

In the FAQ there are plenty of good examples


There are couple of options you could try:

  • Check out Google Apps IMAP migration guide, you can setup an Google Apps IMAP account as a temporary placeholder account while you do the transfer.
  • Use a third party service like YippieMove. Note that this costs $15 per account
  • Do it yourself! A blog post on how you can transfer mails using PHP

Use the reliable Mutt (http://www.mutt.org/).

  1. mutt -f imap://username@sourceimaphost/INBOX/folder
  2. Tag selected messages by t, or tag all messages by T and entering ~A. (With T, you can specify various patterns (http://www.mutt.org/doc/manual/manual-4.html#ss4.2).
  3. Move tagged messages by ;s("save") and enter imap://username@destimaphost/INBOX/folder. (This marks the source messages as deleted(D); if you don't want that, use ;C("copy") instead.)
  4. You can repeat 2 and 3 as needed.
  5. Quit by q. You may choose to purge the deleted messages.

This allows to move a folder from one account to another. Repeat this for multiple folders.