Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a Unix-based tool, such as a shell script or command-line program, to copy IMAP folders from one server to another. Ideally, the tool should copy all the folders for a single account (Inbox, Sent, Trash, and user-created folders) at once, rather than one folder at a time. It should preserve message dates. As an option, I'd like to be able to copy just a single IMAP folder.

Alternatively, is there a tool to copy an mbox file to an IMAP server? I have direct access to the mbox files in the filesystem, but not to the filesystem of the remote IMAP server.

Edit: Is there a way for a user to migrate their own questions to Server Fault?


migrated from Feb 5 '11 at 5:08

This question came from our site for professional and enthusiast programmers.

locked by HopelessN00b Dec 5 '14 at 2:13

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

check also imapsync, a great tool !!!

Thanks. I'll take a look. – Barry Brown Nov 2 '08 at 17:54
This program works like a charm! – Barry Brown Feb 19 '09 at 7:51
imapsync is no longer free. It costs about $35. But it still works quite well. – Barry Brown Dec 15 '10 at 19:47
great tool, it worth the money, i have some great experiences using it when it was free. – Paul Feb 5 '11 at 6:47
Happens to be free on macports: – yuku Jan 26 '12 at 11:53

Take a look at offlineimap - it can sync multiple imap servers, do server-to-maildir, and probably the other way around as well.

A +1 for offlineimap -- which has a Debian package, by the way, so you can easily apt-get offlineimap. A brilliant tool for replicating mailboxes. – Jeremy McGee May 8 '11 at 9:12
It seems to work well. It's too bad the author thinks his documentation is all that. You better grab the example file from GIT: Of course the version that's in Squeeze is not the latest. So beware. It works for Gmail BTW. – d-_-b Oct 15 '12 at 2:59
To save others the chain of links, offlineimap has moved here: – Klox Dec 26 '12 at 21:04

I'm a "fan" of these perl utils: and have used them a fair bit

I am looking at this question by google search, but this answer really helped me, thanks a lot! +1 – Karel Bílek Jun 17 '11 at 4:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.