Cool Tool: IMAPCOPY

SHARE WITH YOUR NETWORK!

Table of Contents

Cool Tool: IMAPCOPY

Have you ever had to migrate mailboxes from server X to server Y? Unfortunately, each type of MTA natively stores mailboxes and folders differently from other MTAs:

  • Some store the entire mailstore for a user in a single flat file
  • Others store them in a folder hierarchy with individual messages being stored as individual text files, where the folder hierarchy reflects the IMAP/Webmail folder structure of the mailbox
  • Yet others store messages in a database of some sort

In other words, there really isn’t a single standard way to store mailbox information. The only way to get around that is to use a common protocol, and IMAP fits the bill.

In the *NIX world, there are tons of IMAP copy tools that let you move messages from one IMAP server to another.  There aren’t that many in the Windows world, but I did find one that works wonderfully well: called “IMAPCOPY” by Armin Diehl (covered by GPL).

http://home.arcor.de/armin.diehl/imapcopy/imapcopy.html

It’s a simple executable called imapcopy.exe with a corresponding configuration file (imapcopy.cfg). To use it, just supply it with the following information:

  • Source server information
  • Destination server information
  • Copy statements (address + clear text password for both source and destination servers)
Example:

SourceServer X.X.X.X

SourcePort 143

DestServer Y.Y.Y.Y

DestPort 143

Copy user1@domain.com somepass user1@domain.com somepass

Copy user2@domain.com somepass user2@domain.com somepass … so on and so forth

Common parameters to use are:

-E (Copy Empty Folders)

-S (Copy Subscription Flags)

-T (Run in test mode only)

Your mileage may vary. Some servers just want the username without the domain, while others want the full Email address, so it’s good to experiment first.

*****

I wrote my own quick & dirty tool that takes a CSV file and turns it into an almost-ready-to-use imapcopy.cfg file. Just edit the source server and destination server in the resulting imapcopy.cfg.

The tool needs a CSV file as an input containing:

EmailAddress,Password(clear text)

Example:

user1@domain.com,somepass

user2@domain.com,otherpass

To use:

makecfg <inputfile.csv> [-s] [-d]

-s = strip domain from source

-d = strip domain from destination

The default is don’t strip, and it will output the imapcopy.cfg file to the same folder in which you run the program.

You can download the executable here:

http://support.vircom.com/supteam/makecfg.zip

 

Obviously, this tool is provided as-is <grin>.

 

 

Explore our Advanced Email Security Solutions

Protect your clients and simplify your operations with reliable, scalable email security solutions. Get in touch today to learn how we can support your success.

SHARE WITH YOUR NETWORK!

Ready to See the Difference?
Discover our advanced security products today.

Scroll to Top