How to migrate mailbox between IMAP Servers with imapsync

imapsync software is a command line tool allowing incremental and recursive imap transfers from one mailbox to another, both anywhere on the internet or in your local network.

imapsync is useful for imap account migration or imap account backup.

imapsync is not adequate for maintaining two active imap accounts in synchronization where the user plays independently on both sides. Use offlineimap (written by John Goerzen) for this purpose.

————————————————

First, create same mailbox on the new mail server.

Then, install imapsync on CentOS: (It doesn’t matter where we install imapsync – we can even install it on a third server.)
yum install imapsync

I’ll use the following data for migration
Old mail server: mail1.mazentop.com
New mail server: mail2.mazentop.com
Old mailbox: support@mazentop.com
New Mailbox: support@mazentop.com
Save old mailbox password in file: /etc/mailpass1
Save new mailbox password in file: /etc/mailpass2

Migrate the old email in support@mazentop.com on server mail1 to the new mailbox support@mazentop.com on server mail2:
imapsync --host1 mail1.mazentop.com --user1 support@mazentop.com --passfile1 /etc/mailpass1 --host2 mail2.mazentop.com --user2 support@mazentop.com --passfile2 /etc/mailpass2

2 thoughts on “How to migrate mailbox between IMAP Servers with imapsync

  • Thursday June 2nd, 2011 at 19:49
    Permalink

    Hi,

    Postfix is a SMTP server, there is no “Postfix mailbox”. You have to detect the IMAP server holding mailboxes. Postfix delivers messages to an IMAP server via a deliver agent. Postfix doesn’t know it deliver to IMAP or POP or file or command. The title is wrong, the body is good.

    Reply
  • Saturday June 4th, 2011 at 21:21
    Permalink

    Hi Gilles,

    Thanks for pointing out my mistake! I was trying to add more keywords to the title. 🙂

    I came across your website and found the Imapsync utility really helpful. so excited to see you here.

    Reply

Leave a Reply to Gilles LAMIRAL Cancel reply

Your email address will not be published. Required fields are marked *