How to install Imapsync in Linux server

imapsync is a tool for facilitating incremental recursive IMAP transfers from one mailbox to another. It is useful for mailbox migration or backup, and reduces the amount of data transferred by only copying messages that are not present on both servers. Read, unread, and deleted flags are preserved, and the process can be stopped and resumed. The original messages can optionally be deleted after a successful transfer.

This article explains the detais of installation and and the further details of imapsync tool.

For installing imapsync, use the following commands

# perl -MCPAN -e "install Test::Inter"
# perl -MCPAN -e "install Parse::RecDescent"
# perl -MCPAN -e "install Getopt::Long"
# perl -MCPAN -e "CPAN::Shell->force(qw(install Date::Manip));"
# perl -MCPAN -e "CPAN::Shell->force(qw(install Mail::IMAPClient));"
# perl -MCPAN -e "CPAN::Shell->force(qw(install Term::ReadKey));"
# wget http://packages.sw.be/imapsync/imapsync-1.350-1.el5.rf.noarch.rpm
# rpm -i --nodeps imapsync-1.350-1.el5.rf.noarch.rpm

imapsync command basic syntax is given below.

# imapsync --host1 <Source_Server> --user1 <source_server_username> --password1 <source_user_pass> --host2 <Desination_Server> --user2 <Destination_Server_username> --password2 <Destination_user_pass>

If need to speficy the port use the below format.

# imapsync --host1 <Source_Server> --user1 <source_server_username> --password1 <source_user_pass> --ssl1 --port1 993 --host2 <Desination_Server> --user2 <Destination_Server_username> --password2 <Destination_user_pass> --ssl2 --port1 993 --noauthmd5ls

Note:
SSL ports needs perl modules. So if you are getting the below error message,

Can't locate IO/Socket/SSL.pm in @INC

Use the following command to correct this problem.

# yum install perl-IO-Socket-SSL

Leave a Reply

Your email address will not be published. Required fields are marked *