It may happen that you have to migrate out of necessity, mailboxes or even entire mail servers that maybe use different email storage formats such as Mailbox and maildir, incompatible or extremely difficult candidates for a raw migration by only moving files from one folder to another working at the filesystem level, or simply the desire to migrate the contents of a mailbox (perhaps one of the free ones like gmail, to our new domain).
The best, most professional and performing solution is to use the tool IMAPSYNC extension that working on the command line allows you to perform an incremental migration from box A to box B in a completely painless way.
This tool recoverable on http://freshmeat.net/projects/imapsync/ and available for windows and Linux systems, it can be installed very easily via apt for debian and derived systems and yum for derived Redhat systems.
In addition to downloading and installing the tool correctly, you need to have IMAP access to both mailboxes is among the fundamental prerequisites, both the source and the destination.
If you do not have IMAP support available even on one of the two, try to talk to the supplier to enable the IMAP protocol which responds on the default port 143. In some rare cases the IMAP protocol could be an additional value-added service, in most cases, a feature enabled in all hosting providers and mail service providers.
Obviously you will also need to know the IMAP parameters of the source server, the destination server and the credentials of the respective source and destination boxes, i.e. username and password.
To be clear in short, you must have all the data (the same identical) that you would use if you were configuring your e-mail account on one of the mail clients such as outlook, mail for MacOS or any other you want.
Its use is decidedly elementary: in practice it is necessary to pass the data to connect to the server from which to copy and then those of the server where the e-mails are to be copied.
Syntax and operation.
The command line syntax is concerned with essentially specifying the host name and credentials for both the source and destination servers.
An example is the following:
imapsync --host1 SERVER_ADDRESS1 --user1 USER_1 --host2 SERVER_ADDRESS2 --user2 USER_2 --authmech1 PLAIN --authmech2 PLAIN --noauthmd5 --ssl2
Obviously you will have to replace some parts above:
SERVER_ADDRESS1 is the IP address or hostname of server number 1
SERVER_ADDRESS2 is the IP address or hostname of server number 2
USER_1 is the user on server number 1
USER_2 is the user on server number 2
The script will ask you for the passwords of the two users, after which the synchronization will begin.
The –ssl2 parameter is necessary as PLAIN authentication is usually only allowed on the ssl encrypted channel.
imapsync has the advantage of synchronizing servers incrementally, the files already synchronized are no longer moved allowing a shorter time in case of subsequent synchronizations.
Among the available options we can indicate whether to use an ssl connection, exclude messages that are too big or too old and / or exclude entire directories.
Be careful to always match the source and destination e-mails, and to correctly enter the e-mail credentials on the source and destination account (which could generally be different: normally the passwords are first set all the same, both originally than in destination, to do first).
If you have difficulty using this tool, you can opt for an outsourcing consultancy and contact us directly at our address https://managedserver.it/supporto