[NOTICE] New account registration is currently closed. Existing members are unaffected.
itpromail
home / docs / migration

Migrate mail with imapsync

imapsync copies mail between IMAP servers, folder by folder, and it can be re-run safely to pick up new messages. Use it to move a mailbox from another IMAP provider into ITProMail. Always run a dry run first, so you can see what will be copied before any message is written to the destination.

Before you start

  • Create your ITProMail account and an app password for the migration in Account > Security. See app passwords.
  • Check your storage plan. The mailbox has to fit under its quota. See storage quotas.
  • Get working IMAP credentials for the source account. Many providers require an app password for IMAP access.
  • Messages larger than the 50 MB limit cannot be stored in ITProMail, so expect those to fail.

Keep passwords in files

Put each password in its own file, readable only by you, and pass the paths with --passfile1 and --passfile2. This keeps the passwords out of your shell history and out of the process list.

chmod 600 ~/.imapsync/src.pass ~/.imapsync/dst.pass

Dry run first

imapsync --dry \
  --host1 imap.example.com --ssl1 --user1 old@example.com --passfile1 ~/.imapsync/src.pass \
  --host2 imap.itpromail.com --ssl2 --user2 you@example.org --passfile2 ~/.imapsync/dst.pass \
  --automap

With --dry, imapsync connects to both servers and reports the folders and messages it would copy, without writing anything. Read the output for folder names that do not map the way you expect, message counts that look wrong, and any errors reported by the destination, such as size limits.

Run the copy

When the dry run looks right, run the same command without --dry. imapsync copies only messages that are missing on the destination, so running it again after an interruption, or to pick up mail that arrived in the meantime, is normal. Do not add --delete2 until you have checked the result. That option removes destination messages that do not exist on the source.

Check the result

  • Compare message counts per folder in the source and in ITProMail.
  • Log in to webmail and open a sample of messages from each folder, including ones with attachments.
  • Check that folder names are right and that Sent and Drafts landed where you expect.
  • Open a few messages you know were large or PGP-encrypted.

Cut over

Keep the source account running until the copy is verified. Then point your clients at ITProMail using the settings in IMAP and SMTP settings. If the domain is yours, update mail routing as described in custom domains. After the switch, run imapsync once more to catch any mail that was delivered to the old account during the change.