IMAPCopy for Email Migration

Posted: 5p in Linux

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

———–

Advertisements
Comments
  1. blog says:

    Fantastic site. A lot of useful information here. I am sending it to several buddies ans additionally sharing in delicious. And obviously, thanks in your effort!

  2. Corinne says:

    Very rapidly this web page will be famous among all blog people, due to it’s nice
    articles or reviews

  3. JoAnCa says:

    When I try to import mailboxes using imapcopy, the process fails to access the IMAP server iRedmail

    This is the error message:
    Log on as user1 failed DestinationServer

    How can I resolve this error?

    • Renjith Raju says:

      Please check both Destination and Source email address are correct or not, also check the port is opened in destination.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s