Skip navigation

That’s right, folks. After the grueling 72hr dovecot-to-gmail (Google Apps) migration ~1.5 years ago, it’s that time of the decade where we are going to do it in reverse!

In fairness to Google, their migration API back then was weak (or non-existent?).  Mails have to be sent one by one via SMTP.  Lucky for us, Gmail-to-IMAP isnt that painful, thanks to imapsync.

imapsync is a tool for facilitating incremental recursive IMAP transfers from one mailbox to another. It is useful for mailbox migration, and reduces the amount of data transferred by only copying messages that are not present on both servers. Read, unread, and deleted flags are preserved, and the process can be stopped and resumed. The original messages can optionally be deleted after a successful transfer.

Usage is very simple:

./imapsync –host1 imap.gmail.com –port1 993 –user1 user@gmail.com –passfile1 /home/user/passwordfile –ssl1 \

–host2 mail.domain.com –port2 993 –user2 user –passfile2 /home/user/passwordfile –ssl2

It’s safer to use –passfile than –password so that your password does not show in ‘ps’, in case there are other users in the server.  imapsync is written in perl and requires additional modules:

Mail::IMAPClient
IO::Socket
IO::Socket::SSL
Digest::MD5
Digest::HMAC_MD5
Term::ReadKey
Date::Manip

Your IMAP folders may not appear on your mail client. You may have to manually subscribe to your folders.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: