Syncing or migrating IMAP e-mail accounts

There’s a free open source tool called imapsync that let’s you copy mail from one IMAP server to another. I’ve used this tool a lot when migrating e-mailaccounts to another server. Aside from copying e-mails from one server to another you can also keep them in sync. Check out the manpage for imapsync to see what’s possible, there are a lot of flags and parameters.

Here’s an example of syncing an e-mail account from one server to another.

$ docker run --rm -it gilleslamiral/imapsync imapsync \
    --syncinternaldates --noreleasecheck --no-modulesversion \
    --host1 \
    --tls1 \
    --user1 \
    --password1 abcdef \
    --host2 \
    --tls2 \
    --delete2 \
    --user2 \
    --password2 abcdef

Take note of the --delete2 flag which deletes e-mails on that aren’t on, thus keeping them in sync.

Scroll to Top