imapsync --host1 imap.old.example.com --user1 user@example.com --password1 secret --host2 imap.new.example.com --user2 user@example.com --password2 secret

Category: Mail Servers & Postfix

imapsync --host1 imap.old.example.com --user1 user@example.com --password1 secret --host2 imap.new.example.com --user2 user@example.com --password2 secret

Migrate a mailbox between IMAP servers

Copies all folders, messages, and flags from one IMAP account to another, skipping messages that already exist on the destination so reruns are safe. Run with --dry first to preview, and consider --useheader Message-Id when duplicates appear. No deletions happen unless --delete2 is given.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.