Go to main content
You are here:
Print

You may need to migrate email boxes or even entire mail servers that use different email storage formats like Mailbox and Maildir , which are incompatible or extremely difficult candidates for a raw migration by simply moving files from one folder to another while working at the filesystem level. Alternatively, you may simply want to migrate the contents of a mailbox (perhaps a free one like Gmail) to your new domain.

The best, most professional and high-performance solution is to use the IMAPSYNC tool which, working from the command line, allows you to perform an incremental migration from mailbox A to mailbox B in a completely painless way.

This tool, which can be found at http://freshmeat.net/projects/imapsync/ and is available for Windows and Linux systems, can be installed extremely easily via apt for Debian and derived systems and yum for derived Redhat systems.

Prerequisites

In addition to downloading and correctly installing the tool, one of the fundamental prerequisites is also IMAP access to both the source and destination mailboxes .

If you don't have IMAP support on even one of the two, try to talk to your provider to enable the IMAP protocol that 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 by all hosting providers and email 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 quite basic : basically you need to pass it the data to connect to the server from which to copy and then the data of the server to which the emails 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 , files already synchronized are no longer moved allowing for less 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 outsourcing consultancy and contact us directly at our address https://managedserver.it/supporto

 

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.

0256569681

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

Contact us online

Open a request directly in the contact area.

DISCLAIMER, Legal Notes and Copyright. RedHat, Inc. holds the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of the AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. holds 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 holds the rights to Oracle®, MySQL®, MyRocks®, VirtualBox®, and ZFS®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; PostgreSQL® is a registered trademark of PostgreSQL Global Development Group; SQLite® is a registered trademark of Hipp, Wyrick & Company, Inc.; KeyDB® is a registered trademark of EQ Alpha Technology Ltd.; Typesense® is a registered trademark of Typesense Inc.; 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; HAProxy® is a registered trademark of HAProxy Technologies LLC; Traefik® is a registered trademark of Traefik Labs; Envoy® is a registered trademark of CNCF; Adobe Inc. owns the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; Shopware® is a registered trademark of Shopware AG; OpenCart® is a registered trademark of OpenCart Limited; Automattic Inc. holds the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert owns the rights to Drupal®; Shopify® is a registered trademark of Shopify Inc.; BigCommerce® is a registered trademark of BigCommerce Pty. Ltd.; TYPO3® is a registered trademark of the TYPO3 Association; Ghost® is a registered trademark of the Ghost Foundation; Amazon Web Services, Inc. owns the rights to AWS® and Amazon SES®; Google LLC owns the rights to Google Cloud™, Chrome™, and Google Kubernetes Engine™; Alibaba Cloud® is a registered trademark of Alibaba Group Holding Limited; DigitalOcean® is a registered trademark of DigitalOcean, LLC; Linode® is a registered trademark of Linode, LLC; Vultr® is a registered trademark of The Constant Company, LLC; Akamai® is a registered trademark of Akamai Technologies, Inc.; Fastly® is a registered trademark of Fastly, Inc.; Let's Encrypt® is a registered trademark of the Internet Security Research Group; Microsoft Corporation owns the rights to Microsoft®, Azure®, Windows®, Office®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®; Apache® is a registered trademark of The Apache Software Foundation; Apache Tomcat® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group; Docker® is a registered trademark of Docker, Inc.; Kubernetes® is a registered trademark of The Linux Foundation; OpenShift® is a registered trademark of Red Hat, Inc.; Podman® is a registered trademark of Red Hat, Inc.; Proxmox® is a registered trademark of Proxmox Server Solutions GmbH; VMware® is a registered trademark of Broadcom Inc.; 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; Grafana® is a registered trademark of Grafana Labs; Prometheus® is a registered trademark of The Linux Foundation; Zabbix® is a registered trademark of Zabbix LLC; Datadog® is a registered trademark of Datadog, Inc.; Ceph® is a registered trademark of Red Hat, Inc.; MinIO® is a registered trademark of MinIO, Inc.; Mailgun® is a registered trademark of Mailgun Technologies, Inc.; SendGrid® is a registered trademark of Twilio Inc.; Postmark® is a registered trademark of ActiveCampaign, LLC; cPanel®, LLC owns the rights to cPanel®; Plesk® is a registered trademark of Plesk International GmbH; Hetzner® is a registered trademark of Hetzner Online GmbH; OVHcloud® is a registered trademark of OVH Groupe SAS; Contabo® is a registered trademark of Contabo GmbH; IONOS® is a registered trademark of IONOS SE; International Business Machines Corporation owns the rights to IBM® and IBM Cloud®; Terraform® is a registered trademark of HashiCorp, Inc.; Ansible® is a registered trademark of Red Hat, Inc.; cURL® is a registered trademark of Daniel Stenberg; Facebook®, Inc. owns the rights to Facebook®, Messenger® and Instagram®. This site is not affiliated with, sponsored by, or otherwise associated with any of the above-mentioned entities 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. All other trademarks mentioned are the property of their respective registrants. MANAGED SERVER® is a European registered trademark of MANAGED SERVER SRL, with registered office in Via Flavio Gioia, 6, 62012 Civitanova Marche (MC), Italy and operational headquarters in Via Enzo Ferrari, 9, 62012 Civitanova Marche (MC), Italy.

JUST A MOMENT !

Have you ever wondered if your hosting sucks?

Find out now if your hosting provider is hurting you with a slow website worthy of 1990! Instant results.

Close the CTA
Back to top