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
1 |
apt install imapcopy |
To migrate mailbox, create a file
1 |
vi ImapCopy.cfg |
Create config file
1 2 3 4 5 6 7 |
SourceServer SOURCE_SERVER_IP SourcePort 143 DestServer DESTINATION_SERVER_IP DestPort 143 skipfolder INBOX.Trash skipfolder INBOX.Spam |
In above file, replace SOURCE and DESTINATION server IP, user and passwords.
To start the email migration, run
1 |
imapcopy |
You can test the config with command
1 2 |
imapcopy -t imapcopy -i |