How to install and use imapsync on Debian


imapsync is a convenient CLI tool that allows migration of emails from one inbox / server to another while using the IMAP protocol.

The author of this tool decided to sell the sources for 50 bucks.. someone bought the sources pushes it on Github .. because imapsync isn’t available in Debian’s repositories anymore.

Installing imapsync on Debian is quite straightforward:
apt-get install makepasswd libunicode-string-perl libmail-imapclient-perl libio-tee-perl libterm-readkey-perl git
git clone imapsync.git
cd imapsync
mkdir dist
> ./dist/path_1.644.txt
make install

Using imapsync doesn’t require a complicated tutorial :
To synchronise content from the account “foo” on server “” to account “bar” on “” with foo’s password being “secret1” and bar’s being “secret2”:

imapsync \
--host1 --user1 foo --password1 secret1 \
--host2 --user2 bar --password2 secret2

If you were to migrate emails between Google accounts, the command line can look as follows :
imapsync --syncinternaldates --host1 --port1 993 --ssl1 --user1 [email protected] --password1 MOTDEPASSE1 --host2 —port2 993 --ssl2 --user2 [email protected] --password2 MOTDEPASSE2 --useheader 'Message-Id' --skipsize --noauthmd5 --reconnectretry1 1 --reconnectretry2 1 --authmech1 LOGIN --authmech2 LOGIN

Leave a Reply