how to install and use imapsync2 min read

We need your support!!
Other Amount:
24-Hour Flash Sale. Courses from just ₹ 490.
Prabhin Prabharkaran Administrator
DevOps Engineer

He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!

follow me

Hi readers, this document deals with how to install and use imapsync.
IMAPSYNC is opensource migration tool use for migrating emails from one IMAP account to another. Imapsync works on windows Linux and mac os. It’s a command line tool, where you can stop the migration and start it again from the point where it got stops before. Imapsync migrates only emails not calendar events and contacts.

Now let’s see how to install imapsync and use it for mail migration.

Here I have chosen Ubuntu 16.04 for installing imapsync. If you are using any other operating system make sure that you fulfilled the installation of other dependency packages.

Install Dependencies

sudo apt-get install libauthen-ntlm-perl libclass-load-perl libcrypt-ssleay-perl libdata-uniqid-perl libdigest-hmac-perl libdist-checkconflicts-perl libfile-copy-recursive-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 cpanminus

Download imapsync

git clone

Compile and Install

cd imapsync
mkdir dist
sudo make install

Check version

imapsync -v

Now start migration single user,

imapsync --host1 server1 -user1 user@server1 --password1 user1password --ssl1 --host2 server2 --user2 user@server2 --password2 user2password --ssl2


Bulk user migration

The file.txt file contains for example:


Most of the times, the first column (host001_1, host002_1 …) will
contain the same value, the value of –host1 parameter. Same
thing for the third column (host001_2, host002_2).

On Unix the shell script can be:

{ while IFS=';' read h1 u1 p1 h2 u2 p2 fake
imapsync --host1 "$h1" --user1 "$u1" --password1 "$p1" \
--host2 "$h2" --user2 "$u2" --password2 "$p2" "$@" 
} < file.txt

You can add extra options inside this script, just after the variable “$@”.
You can also pass extra options via the parameters of this script
since they will go in “$@”

Here is a complete Unix example ready to use:

More information can be found on the official imapsync website.


We need your support!!
Other Amount:
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

You may also like...

Leave a Reply