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 https://github.com/imapsync/imapsync.git

Compile and Install

cd imapsync
mkdir dist
sudo make install

Check version

imapsync -v
1.882

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:

host001_1;user001_1;password001_1;host001_2;user001_2;password001_2;
host002_1;user002_1;password002_1;host002_2;user002_2;password002_2;
host003_1;user003_1;password003_1;host003_2;user003_2;password003_2;
host004_1;user004_1;password004_1;host004_2;user004_2;password004_2;
etc.

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:

#!/bin/sh
{ while IFS=';' read h1 u1 p1 h2 u2 p2 fake
do 
imapsync --host1 "$h1" --user1 "$u1" --password1 "$p1" \
--host2 "$h2" --user2 "$u2" --password2 "$p2" "$@" 
done 
} < 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:
http://imapsync.lamiral.info/examples/sync_loop_unix.sh

More information can be found on the official imapsync website.
https://imapsync.lamiral.info/

Reference: http://imapsync.lamiral.info/FAQ.d/FAQ.Massive.txt

© 2018, Techrunnr. All rights reserved.

#1
#2
#3
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!!

0 Comments

Leave a Reply