IMAPCopy
IMAPCopy is a small command line tool to copy messages for multiple users from one imap server to another
root@cPanel1 [~]# cd /opt/
root@cPanel1 [/opt]# wget http://home.arcor.de/armin.diehl/imapcopy/imapcopy.tar.gz
root@cpanel1 [/opt]# tar -xvf imapcopy.tar.gz
imapcopy/
imapcopy/imapcopy
imapcopy/ImapCopy.cfg
root@cpanel1 [/opt]# cd imapcopy
root@cpanel1 [/opt/imapcopy]# ll
total 956
drwxr-xr-x 2 ihrblche cpanellogin 4096 Jul 18 2009 ./
drwxr-xr-x 29 root root 4096 Nov 28 05:38 ../
-rwxr-xr-x 1 ihrblche cpanellogin 955681 Jul 18 2009 imapcopy*
-rw——- 1 ihrblche cpanellogin 2527 Jul 18 2009 ImapCopy.cfg
Edit ImapCopy.cfg under the “Sourceserver” section give the source server IP/Hostname and IMAP port. Then under the “Destinationserver” section give the Plesk server IP/Hostname and IMAP port. Last you can see the section “List of users and passwords”. Here you have to specify the email address and password details.
##############
# Sourceserver
##############
SourceServer localhost
SourcePort 143
###################
# Destinationserver
###################
DestServer 216.70.XXX.XXX
DestPort 143
#############################
# List of users and passwords
#############################
# SourceUser SourcePassword DestinationUser DestinationPassword
Copy “test1admin@domain” “o0Jj9t_6″ “test1admin@domain” “o0Jj9t_6″
Before starting the email migration you can test the working. If you find any connection issues, correct it and then you can start the migration.
Login on sourceserver as test1admin@domain OK
Login on destinationserver as test1admin@wdomainm OK
Getting folderlist on sourceserver OK, found 5 folder
1 User processed, 0 Messages copied, 0 Error(s)
0 Folder(s) created, 0 Folder create errors, 0 Folder not copied
After testing you can start the migration by executing imapcopy
root@cpanel1 [/opt/imapcopy]# ./imapcopy
Login on sourceserver as test1admin@domain OK
Login on destinationserver as test1admin@domain OK
Getting folderlist on sourceserver OK, found 5 folder
Getting List of messages in “INBOX” OK, 0 Messages found
Getting List of messages in “INBOX.Drafts” OK, 0 Messages found
Getting List of messages in “INBOX.Sent” OK, 0 Messages found
Getting List of messages in “INBOX.Trash” OK, 0 Messages found
Getting List of messages in “INBOX.Junk” OK, 0 Messages found
1 User processed, 0 Messages copied, 0 Error(s)
0 Folder(s) created, 0 Folder create errors, 0 Folder not copied
———–