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.
Imapsync 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.
Run the following command via the console / terminal:
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.
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):
imapsync - host1 192.168.10.2 - user1 email@example.com - passwordbudi password1 - host2 192.168.10.1 - firstname.lastname@example.org.
user2 - password2 passwordvavai - noauthmd5 -ssl1 -ssl2
The above command will copy the mailbox email@example.com on server 192.168.10.2 to the mailbox firstname.lastname@example.org 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
- – – follows by words are Imapsync parameters. –user1 email@example.com means that user account in first server is firstname.lastname@example.org
- 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
- Imapsync requires a password for each account to be successfully synchronized.
- 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.