• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

How to Migrate Mailboxes Easily With Imapsync on CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
186
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Using a Different System?
  2. Prerequisites
  3. Installation
  4. Syncing Emails
  5. Passwords
  6. The connection to the IMAP server
  7. Folders
  8. Migration options
  9. Want to contribute?

Using a Different System?

  • How to Migrate Mailboxes Easily With Imapsync on Ubuntu 16.04 LTS

Are we missing a guide for your target system? Request one, or submit your own!


While migrating websites is usually not a problem, sometimes it’s more difficult to migrate email boxes. This is especially the case when two servers do not use the same software. Fortunately, Imapsync can simplify this task.

Imapsync makes it possible to synchronize mailboxes using the IMAP protocol. This will only work if you also use IMAP to retrieve your emails, or if you do not erase your emails from the server with the POP protocol.

Prerequisites

  • A Vultr CentOS 7 server instance.
  • A sudo user.

Installation

Install access to the EPEL repository via yum.

sudo yum install epel-release

Install the necessary prerequisites to run Imapsync.

sudo yum install perl-App-cpanminus /
perl-Dist-CheckConflicts /
perl-HTML-Parser /
perl-libwww-perl /
perl-Module-Implementation /
perl-Module-ScanDeps /
perl-Package-Stash /
perl-Package-Stash-XS /
perl-PAR-Packer /
perl-Regexp-Common /
perl-Sys-MemInfo /
perl-Test-Fatal /
perl-Test-Mock-Guard /
perl-Test-Requires /
perl-Test-NoWarnings /
perl-Test-Deep /
perl-Test-Warn /
perl-Try-Tiny

Download the latest Imapsync code from its official Git repository.

git clone https://github.com/imapsync/imapsync.git

Navigate to the newly cloned repository and install it with the following commands on your system.

cd imapsync
mkdir -p dist
sudo make install

You can check the version of Imapsync using the following command.

imapsync -v

Syncing Emails

The syntax for syncing emails from server1 to server2 using only the required options is shown below.

imapsync --host1 server1.imap.tld --user1 [email protected] --password1 password1  --host2 server2.imap.tld --user2 [email protected] --password2 password2

Passwords

To avoid entering plain text mailbox passwords, you can store them in files and use the --passfile1 and --passfile2 arguments to automatically load them from the files containing the passwords.

imapsync --host1 server1.imap.tld --user1 [email protected] --passfile2 /home/user/pass1 --host2 server2.imap.tld --user2 [email protected] --passfile2 /home/user/pass2

The connection to the IMAP server

Several options are available to connect Imapsync to your mail server, including the type of connection used. By default, Imapsync will try to use SSL or TLS on port 993 to connect. The following are examples for the connection on the server to migrate (replace 1 with 2 for the second server).

  • --nossl1 for an unencrypted connection via port 143 (not recommended)
  • --ssl1 for an encrypted connection with SSL via port 993
  • --tls1 to connect with TLS via port 993

There are also options to define the type of authentication. This is specified with the --authmech1 and --authmech2 arguments, whose possible values are as follows (in upper case).

  • PLAIN
  • LOGIN
  • CRAM-MD5

Folders

Folder synchronization can cause problems, especially if the default folders, (“Inbox”, “Spam”, “Archive”, “Sent”), are not named the same on both mail servers. Imapsync offers several options for this:

  • --automap to use automatic default folder recognition.
  • --nomixfolders to avoid merging folders with a similar name according to case sensitivity.
  • --prefix1 to remove a prefix from the folders to migrate.
  • --prefix2 to add a prefix to migrated folders.
  • --skipemptyfolders to not recreate empty folders on the destination server.

Migration options

To speed up email migration, you can use the --usecache argument to temporarily store the folders on the server where you installed Imapsync.

You can also delete messages from the first server with the --delete1 argument.

Finally, before starting your migration, do not hesitate to use the --dry argument to check the result of a command, without executing it.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

Installing Bolt CMS on FreeBSD 12

Next Post

Install Rancher on CentOS 7

Next Post

Install Rancher on CentOS 7

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet