How Can We Help?
You are here:

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 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


Table of Contents

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.


Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.


Managed Server Srl is a leading Italian player in providing advanced GNU/Linux system solutions oriented towards high performance. With a low-cost and predictable subscription model, we ensure that our customers have access to advanced technologies in hosting, dedicated servers and cloud services. In addition to this, we offer systems consultancy on Linux systems and specialized maintenance in DBMS, IT Security, Cloud and much more. We stand out for our expertise in hosting leading Open Source CMS such as WordPress, WooCommerce, Drupal, Prestashop, Joomla, OpenCart and Magento, supported by a high-level support and consultancy service suitable for Public Administration, SMEs and any size.

Red Hat, Inc. owns the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. owns the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds holds the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt. Oracle Corporation owns the rights to Oracle®, MySQL®, and MyRocks®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; REDIS® is a registered trademark of Redis Labs Ltd. F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB. Adobe Inc. holds the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited. Automattic Inc. owns the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert holds the rights to Drupal®. Amazon Web Services, Inc. holds the rights to AWS®; Google LLC holds the rights to Google Cloud™ and Chrome™; Microsoft Corporation holds the rights to Microsoft®, Azure®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®. Apache® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group. CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV Hetzner Online GmbH owns the rights to Hetzner®; OVHcloud is a registered trademark of OVH Groupe SAS; cPanel®, LLC owns the rights to cPanel®; Plesk® is a registered trademark of Plesk International GmbH; Facebook, Inc. owns the rights to Facebook®. This site is not affiliated, sponsored or otherwise associated with any of the entities mentioned above and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. Any other trademarks mentioned belong to their registrants. MANAGED SERVER® is a trademark registered at European level by MANAGED SERVER SRL, Via Enzo Ferrari, 9, 62012 Civitanova Marche (MC), Italy.

Back to top