10
votes

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?

3 Answers 3

6
votes

check also imapsync, a great tool !!!

5
  • This program works like a charm! Feb 19, 2009 at 7:51
  • imapsync is no longer free. It costs about $35. But it still works quite well. Dec 15, 2010 at 19:47
  • great tool, it worth the money, i have some great experiences using it when it was free.
    – Paul
    Feb 5, 2011 at 6:47
  • Happens to be free on macports: trac.macports.org/browser/trunk/dports/mail/imapsync/Portfile Jan 26, 2012 at 11:53
  • I found it on GitHub released under a "NO LIMIT PUBLIC LICENSE" in June of 2012. It looks like a solid package; probably worth paying for it if it works for a big migration.
    – tomlogic
    Jan 2, 2013 at 2:03
5
votes

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

3
  • 1
    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. May 8, 2011 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: github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf Of course the version that's in Squeeze is not the latest. So beware. It works for Gmail BTW.
    – d-_-b
    Oct 15, 2012 at 2:59
  • 2
    To save others the chain of links, offlineimap has moved here: offlineimap.org
    – Klox
    Dec 26, 2012 at 21:04
3
votes

I'm a "fan" of these perl utils: http://www.athensfbc.com/imap_tools/ and have used them a fair bit

1
  • 1
    I am looking at this question by google search, but this answer really helped me, thanks a lot! +1 Jun 17, 2011 at 4:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .