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.

imapsyncImapsync is one very useful tool because it can be used to perform backup and synchronization of all email content, both structure and content. For example, if we have an inbox, sent items, drafts, trash, etc in the old mail server, we can copy the structure and content seamlessly into the new mail server. Imapsync even able to backup a folder other than the default folder, such as copying a folder called “Vavai” and “Urgent”, etc inside my inbox folder.

The following tutorial is the process of installation and usage of Imapsync on SUSELinux Enterprise Server 11 SP 1, although Imapsync can be run in almost all Linux systems.

INSTALLATION

Run the following command via the console / terminal:

1.zypper ar
http://download.opensuse.org/repositories/devel:/languages:/perl/SLE_11 perl
2.http://download.opensuse.org/repositories/home:/pheinlein/SLE_11_SP1/ imapsync
3.zypper ref
4.zypper in imapsync perl-Date-Manip perl-Mail-IMAPClient

Note : I’m using package on openSUSE Build Services to install Imapsync. Do not forget to change the version and type of openSUSE distribution in accordance with your running system.

USAGE

Here is an example of using Imapsync to synchronize a mailbox from the mail server with an IP 192.168.10.2 to the mail server with an IP 192.168.10.1 (Imapsync can also use server hostname instead of ip address):

1.imapsync - host1 192.168.10.2 - user1 budi@namadomain.com - passwordbudi password1 - host2 192.168.10.1 - vavai@namadomain.co.id user2 - password2 passwordvavai - noauthmd5 -ssl1 -ssl2

The above command will copy the mailbox budi@namadomain.com on server 192.168.10.2 to the mailbox vavai@namadomain.co.id on server 192.168.10.1.

Let’s see the user account between primary server and secondary server. As you may notices, Imapsync can be used to copy the email user A to the same mailbox on another server or to a different mailbox on another server

NOTE:

  1. – – follows by words are Imapsync parameters. –user1 budi@namadomain.com means that user account in first server is budi@namadomain.com
  2. Imapsync can be used to synchronize all mail server that supports the IMAP protocol (as the name implies, Imapsync, not POPsync especially lipsync), so it can be used on Postfix+Imap, Sendmail + Imap, Qmail+Imap, MDaemon,Microsoft Exchange etc
  3. Imapsync requires a password for each account to be successfully synchronized.
  4. Imapsync is able to synchronize the password if we know both accounts and password. We have to equate all the passwords if you want to easily synchronize with the command above. Oon some mail servers, we can use Imapsync with the – -authuser to access user mailboxes by using admin privileges.

Leave a Reply

Your email address will not be published.