Migrate Emails using imapcopy
imapcopy is a program to copy mails from one IMAP mailbox to another. I was using this for email migrations. But for a large mailbox with 9300 mails, this failed. So i looked for alternatives. I installed imapsync, it was little annoying to install as it need lot of other packages installed for it to work. But imapsync worked better than imapcopy.
To instal imapcopy on Ubuntu/Debian, run
apt install imapcopy
To migrate mailbox, create a file
vi ImapCopy.cfg
Create config file
SourceServer SOURCE_SERVER_IP SourcePort 143 DestServer DESTINATION_SERVER_IP DestPort 143 skipfolder INBOX.Trash skipfolder INBOX.Spam Copy "[email protected]" "SOURCE_PASSWORD" "[email protected]" "DEST_PASSWORD"
In above file, replace SOURCE and DESTINATION server IP, user and passwords.
To start the email migration, run
imapcopy
You can test the config with command
imapcopy -t imapcopy -i