Java based IMAP Server syncing tool (work in progress).
This tool is inspired in imapsync. mnIMAPSync is still in the early stages although it has been tested in several production systems, it may fail in servers where it has not been tested yet. In the last part of this document there is a list of tested IMAP servers, please notify me if you successfully use mnIMAPSync with another server or create an issue for failing servers.
mnIMAPSync can be used to migrate or backup an IMAP account to another either in the same server or in different servers. The program can be run standalone (command line interface) or accessed directly from java.
- SSL Support
- Api Interface
- Command line execution
- Deletion of no longer existing messages and folders
- Java 1.5
The easiest way is to launch the program from the command-line interface. Download the latest binary release and execute as follows:
java -jar mnIMAPSync.jar --host1 imap.gmail.com --port1 993 --user1 firstname.lastname@example.org --password1 password --ssl1 --host2 other.server.com --port2 143 --user2 email@example.com --password2 password2 --delete
You can also use any of the convenient shell scripts bundled in the distribution to avoid typing
java -jar mnIMAPSync.jar.
You can find a tutorial on how to use and install mnIMAPSync at There is an instructable available at blog.marcnuri.com
||Host of the source mail server.|
||IMAP port of the source mail server.|
||User name for the account on the source mail server.|
||Password for the account on the source mail server.|
||Optional parameter indicating if the program should connect using SSL to the source server.|
||Host of the target mail server.|
||IMAP port of the target mail server.|
||User name for the account on the target mail server.|
||Password for the account on the target mail server.|
||Optional parameter indicating if the program should connect using SSL to the target server.|
||Number of threads to use. Keep in mind some servers limit the number of concurrent connections|
||Optional parameter indicating it the program should delete messages and folders in the target server that don't exist in the source.|
When using imapsync to sync different servers I'm getting lots of duplicate messages in successive runs. This is due to the fact that when dealing with unconventional e-mails, each server stores certain header information in its own way.
This program is based in the principle of maximizing performance avoiding duplicates. If messages that have already been synced are modified (in the non header part [attachments removed...]) this messages won't be copied again.
The process starts indexing mail messages and IMAP folders in the target server. This information will be used later to check if the target server already contains messages we are copying from the source server.
The Index is created in a per folder basis. For each IMAP folder in the target server a separate message index will be created. Every folder in the target server is crawled.
Once the target index is completed, if and only if this process was successful, the copy process begins. If there were errors indexing the target the copying process will abort, not aborting could mean duplicating messages in the target server.
Please, share your experience with any other server.