Skip to content

Imapsync

Imapsync is a tool that allows you to migrate email accounts via IMAP or create backups.

Arguments

--host1 the IMAP server address from which the migration will be performed.
--port1 the port used to connect to host1 (default 143).
--user1 the login used for authentication on host1.
--host2 the IMAP server address to which the migration will be performed.
--port2 the port used to connect to host2 (default 143).
--user2 the login used for authentication on host2.
--tmpdir specifies the ~/tmpimapsync directory for temporary files.

Examples

Before using Imapsync, it is recommended to create a directory for temporary files: ~/tmpimapsync. After the email migration is completed, this directory can be removed.

mkdir ~/tmpimapsync

Warning

The examples below assume that the temporary directory has already been created and is available for Imapsync to use.

Migration of all folders (and emails) from the account [email protected] (IMAP server imap.XXXX.net, IMAP port 993, SSL) to the account [email protected] (IMAP server host2.XXX.net, IMAP port 993, SSL):

imapsync --host1 imap.XXXX.net 
  --port1 993 
  --user1 [email protected] 
  --ssl1 
  --host2 host2.XXX.net 
  --user2 [email protected] 
  --port2 993 
  --ssl2 
  --authmech1 PLAIN 
  --authmech2 PLAIN 
  --addheader 
  --tmpdir ~/tmpimapsync

Migration of the Drafts, Sent, Trash, Spam, and INBOX folders from the account [email protected] (IMAP server imap.XXXX.net, IMAP port 993, SSL) to the account [email protected] (IMAP server host2.XXX.net, IMAP port 993, SSL) using the folder separator "." when NAMESPACE is not supported:

imapsync --host1 imap.XXXX.net 
  --port1 993 
  --user1 [email protected] 
  --ssl1 
  --host2 host2.XXX.net 
  --user2 [email protected] 
  --port2 993 
  --ssl2 
  --authmech1 PLAIN 
  --folder Drafts 
  --folder Sent 
  --folder Trash 
  --folder Spam 
  --folder INBOX 
  --authmech2 PLAIN 
  --sep2 "." 
  --prefix2 "" 
  --addheader 
  --tmpdir ~/tmpimapsync