How to install and use IMAPSYNC on Ubuntu

IMAPSYNC is an incredible utility to migrate email accounts between different servers. It just works.

Problem is the installation is slightly more cumbersome than usual, and the syntax for the uninitiated rather intense.

This article aims to address these two issues.

Let’s kick of with the installation. There’s no official guide except an INSTALL.Ubuntu.txt file on their Github repo. This appears to be outdated since when running the final make install command it actually already copies the binary to the correct place. So our reduced instruction set combines what we see on the Github repo with a beautiful article from

Please note the elaborate apt-get command below actually needs to be used as is. All those backslashes are natural bash command line breaks and included to nicely split the screen per library.

sudo apt-get install \
libauthen-ntlm-perl \
libclass-load-perl \
libcrypt-ssleay-perl \
libdata-uniqid-perl \
libdigest-hmac-perl \
libdist-checkconflicts-perl \
libencode-imaputf7-perl \
libfile-copy-recursive-perl \
libfile-tail-perl \
libio-compress-perl \
libio-socket-inet6-perl \
libio-socket-ssl-perl \
libio-tee-perl \
libmail-imapclient-perl \
libmodule-scandeps-perl \
libnet-dbus-perl \
libnet-ssleay-perl \
libpar-packer-perl \
libreadonly-perl \
libregexp-common-perl \
libsys-meminfo-perl \
libterm-readkey-perl \
libtest-fatal-perl \
libtest-mock-guard-perl \
libtest-mockobject-perl \
libtest-pod-perl \
libtest-requires-perl \
libtest-simple-perl \
libunicode-string-perl \
liburi-perl \
libtest-nowarnings-perl \
libtest-deep-perl \
libtest-warn-perl \
make \

Next we install quite a few Perl libraries

sudo cpanm Crypt::OpenSSL::RSA Crypt::OpenSSL::Random --force
sudo cpanm Mail::IMAPClient JSON::WebToken Test::MockObject 
sudo cpanm Unicode::String Data::Uniqid

Please note the --force If you get errors on that line, run it without --force because there is a good chance the library is already installed first time around in spite of an error. The bottom line is if you get an error, use without --force or just continue.

Our last few steps download IMAPSYNC from Github, and compiles it.

git clone
cd imapsync
mkdir -p dist
sudo make install

Installation done. Here are two examples:

Example 1

Please note in this case the IMAPSYNC command is run on the destination host and data pulled from the source host (a.b.c.d).

imapsync --dry --skipemptyfolders --host1 a.b.c.d --user1 [email protected] --password1 'secret' --host2 --ssl2 --user2 [email protected] --password2 'hopefully_same_secret'

Example 2

imapsync --host1 \
--user1 [email protected] \
--password1 S0urcePassw0rd \
--ssl1 \
--host2 \
--user2 [email protected] \
--password2 Dest1nat10NPassw0rd \

If that’s a bit baffling and cumbersome, use our easy peasy spreadsheet which allows you to generate these commands for a number of users at once by only filling in the usernames and passwords.

Vander Host IMAPSync Demo Spreadsheet



Share this article

Leave a Reply

Your email address will not be published.

Scroll to Top