Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
The Internet

Backing Up an IMAP Folder Tree? 32

Jason Weill asks: "After finishing up school, I'm transitioning away from my school-run IMAP e-mail account. During my time, I managed to save thousands of messages in dozens of subfolders in my 'Inbox' hierarchy. Pine lets me save an entire folder to a file easily. Mozilla creates a folder tree when I drag 'Inbox' into a local repository, but none of the messages in the subfolders are downloaded. Opera M2 assimilates all those messages into my collection, but it flattens them all into one giant mess. Are there any scripts or programs that can easily export an entire folder tree to files or import it into a local repository for an e-mail program?"
This discussion has been archived. No new comments can be posted.

Backing Up an IMAP Folder Tree?

Comments Filter:
  • will do what you need
  • IMAP to IMAP (Score:3, Interesting)

    by reaper20 ( 23396 ) on Friday January 31, 2003 @07:05PM (#5200205) Homepage
    I've done an IMAP to IMAP backup before with mozilla. Setup a new IMAP account in mozmail, and then do one huge drag and drop. It takes a while, but it works.

    Antother options, if you have a shell account and they setup maildirs in your /home, then all you really need to do is tarball that up.
    • Yeah, I was going to say - I was pretty sure I've downloaded all my imap stuff before with Mozilla. Although, if you can't figure out how to do that for some reason, here's a very easy solution: use mozilla to create a bunch of folders on your local machine - then go into each folder, highlight every message at once - and drag it over to the local folder. Yeah, it's a bit more work, but if you can't make the easy way work for you for whatever reason, this method will definitely work with Mozilla, or Netscape 4.7X for that matter.
  • imapxfer (Score:5, Informative)

    by Alrescha ( 50745 ) on Friday January 31, 2003 @07:11PM (#5200239)
    You might want to try imapxfer from the UW-IMAP toolkit:

    http://www.washington.edu/imap/

    The source for the utilities is at:

    ftp://ftp.cac.washington.edu/imap/imap-utils.tar .Z

    A.
  • This is a good question. I too like to carry my mail around with me. I use an IMAP server, but the one that I need the data off of first is my Yahoo Mail account. I want to grab the 20+ Meg of messages that my account has collected over the years, and export them to a cd. I want to ween myself off of their massive MY! application. So, any way to take my mail/address book/notepad/breifcase/photos/etc with me? anyone? anyone?
    • I currently deliver all my e-mail from various sources including Yahoo to a Mercury/32 [pmail.com] IMAP server running on my Win2000 box. This allows me to access my mail from my laptop over 802.11 while taking it off my ISPs servers...

      I have used fetchyahoo (http://fetchyahoo.twizzler.org [twizzler.org]), and yahoopops (http://yahoopops.sourceforge.net/ [sourceforge.net]) to get my mail from Yahoo, and freshmeat also lists another alternative http://mrbook.org/mrpostman/ [mrbook.org]

      I currently use Izymail http://izymail.com [izymail.com] since it handles both yahoo and hotmail in one small package. It also presents an IMAP interface to access subfolders on those accounts.

      You still have to move your mail from POP to IMAP, but that can be handled by most e-mail clients.

      Hope this helps.

      Balam

  • by RevAaron ( 125240 ) <revaaron AT hotmail DOT com> on Friday January 31, 2003 @07:27PM (#5200344) Homepage
    I came to a similar dillemma: I had amassed an amount of email which was pushing me over disk quota at my university. I could've deleted the email or my web page. Didn't sound like a good solution. The email wasn't critically important, but not worthless enough to just delete. But most of them also aren't so important that I need to read one of these old message too often. I was using pine on a Uni's Unix machine.

    I was long wanting to switch to the email client in Squeak, Celeste, as I spend most of my time in Squeak. I even telnet'd from it to access my email from within a client in Squeak.

    So, I setup Celeste to get my mail via POP. Had it download all my messages in my INBOX. Then, I downloaded the mail folders from the Solaris machine. Gzip and ftp. Celeste has the ability to import messages from Unix mailbox files. So I did that, into respective folders/categories. All done, less fuss than reading through the replies in this Ask Slashdot. :)

    Most clients can read mbox format.

    If you can't get to your raw mbox files, it would be easy to write a script to pull out messages via IMAP, and then output them to Unix mbox format. Then import. I was working on a similar thing before figuring out I could simply download my mbox files. I had written most of a script that went to the mail server, iterated over each mail category and saved it to the mail database. Squeak provides a nice MailDB class for it's own mail database format, so it was less than a dozen lines of code.
  • I've done exactly this before. (under gnome)

    I moved one IMAP tree from an old account directly into the new one. I'm not even sure if it downloaded locally first or just moved from one server to the next.

    Screw that outlook express peice of microsoft junk. Whose posting on slashdot lately?? ;-)
  • by pbulteel73 ( 559845 ) on Friday January 31, 2003 @07:28PM (#5200347) Homepage
    Just found this... don't know how well it works, but it looks like it does what you want.

    IMAP Copy [freshmeat.net]

  • I'd like to archive some of my IMAP mail into a subfolder called "archive" with a duplicate tree layout under it. Anyone know an easy way to do this, while keeping mail that is not X days old where it is.
    • Do you have access to the server? You could do something like this in perl:

      ===BEGIN UNTESTED CODE BLOCK===
      #!/usr/bin/perl -w
      use File::stat;
      use strict;

      $username = ""; #Your username here
      my $fileLocation = "/home/username/Maildir/cur";
      my ($yearCreated,$year);
      print "Enter year to remove: "; chomp($year = );
      chdir "$fileLocation";
      while(){
      (undef,undef,undef,undef,undef,$yearCreated,undef) = localtime(stat($_)->mtime);

      if (!copy("$fileLocation/$_", "Archive/$fileLocation/$_")){
      print "Could not Move Files...Exiting...\n\n";
      exit;
      }else{
      print "$fileLocation Was Copied Successfully\n\n\n";
      }
      unlink "$fileLocation/$_" if ($year == ($yearCreated+1900));
      }

      If anyone cares to test it and correct it that would be nice...
  • apt-get install isync
    pkg_add -r isync

    or go to
    http://www.cs.hmc.edu/~me/isync/
  • The last time I had to use an exchange server, I used Netscape 4.7's e-mail client, created local folders, and dragged and dropped each folder from server to local machine folder by folder. Took about an hour for 400MB, IIRC.
  • by Deagol ( 323173 ) on Friday January 31, 2003 @08:39PM (#5200784) Homepage
    As a mail admin, I've been contacted about this. I simply tar'ed up the tree and handed it to the user (so to speak -- I gave him a URL he could snarf it from his new location). He contacted his new mail admin and had him throw the files in place as-is.

    Of course, not all postmasters are that helpful :) But it never hurts to ask.

  • by obi ( 118631 ) on Friday January 31, 2003 @10:14PM (#5201339)
    searching in my debian repo, I find:

    offlineimap - IMAP/Maildir synchronization and reader support

    http://gopher.quux.org:70/devel/offlineimap/

    isync - synchronize a local maildir with a remote IMAP4 mailbox

    http://www.cs.hmc.edu/~me/isync/

  • I believe that fetchmail would do the trick but you would have to tweak its configuration a bit.

    1. You would have to download every imap folder separatelly.

    2. Since default mode of operation for fetchmail is to retrieve mail from server and put it into local smtp system, you would have to direct it to deliver mail to procmail or other program, that would deliver messages to mbox or maildir.

    Robert
  • I just opened a guest account on freemail.fm today. I'm going to try it out to see how well it works. My other "free" IMAP account at freeshell has been unresponsive for 2 days, so I'm thinking of switching. Anyway, the point is that fastmail has a way to copy all of your imap content. It actually conects to your old account and uses some method to transfer them all, folders and all. I haven't tried it yet, since I can't connect to freeshell yet, but that might be an option if you're looking for another provider.
  • use perl (Score:3, Interesting)

    by mike_sucks ( 55259 ) on Saturday February 01, 2003 @12:03AM (#5201798) Homepage
    While I never normally advocate the use of Perl for anything, I've had to do what you're looking for before, and I found the easiest way was to whip up a quick Perl script using libmail-imapclient-perl or libcyrus-imap-perl which recursively sucks your mail off the server.

    The advantages of doing this is that you can then save it into any format you want. I personally was using it to do a IMAP server to server copy, and it worked fantastically.

    If I still had the script, I'd post it, but it was many, many harddrives ago that I saw it last. :(

    /mike
  • by nyamada ( 113690 ) on Saturday February 01, 2003 @12:45AM (#5201971)
    In both OE and Netscape, you can change your preferences to save messages for "offline" viewing. If you do this, you can transfer all your IMAP folder messages to your computer that way. Prepare to wait awhile, if you've really got hundreds of messages.

    If you use NS, I think they're saved in mbox format. In any case, you then have them locally and can archive them from there (or transfer them to your new IMAP server).
  • I just underwent a huge email tribulation at work. I've been on RedHat for about 5 years now, getting my corporate Exchange email through a variety of means. The lastest one was comprised of setting having fetchmail grab my mail from the Exchange server over IMAP, and filter it through spamassassin via procmail. Then I'd grab it through IMAP to my local machine, but the folders (except for the inbox, since this will NOT work) were all on an NFS mount to be backed up. Now I've installed Gentoo, and I wanted less fooling around with email. So I emerged evolution and really explored it. I've been using it at home for a long time now, but besides doing my IMAP mail at home (off my own email server), I like the Palm Pilot integration.

    What does this have to do with you? Sorry, I'm off track. What I found at work is that this thing is the Outlook Express of the Linux world. (If you've never really looked at OE, it's tough. Microsoft actually made a really good product, and then covered it up with their much less useful one, Outlook.) It does like 6 different mail methods, including maildir. (You never said what OS you're using, but I'm assuming it's Linux.) You can set Evolution up to have both your current IMAP server and a maildir heirarchy. (Just create ~/Maildir with /cur, /new, and /tmp subdirs.) Then just drag and drop. If you're on a slow link, it may take awhile, but you can control how this gets done. What I find in these situations is that this is a time for cleaning up. The other methods discussed here will probably be faster, but you probably won't streamline anything with the move.
  • I'm in the middle of migrating a a few thousand accounts from Maildir format spools to Cyrus. I did some hunting on search.cpan.org and found Mail::IMAPClient. The documentation is very concise and the module works like a charm. :)

    That said, I think you could achieve your goal a lot easier with a run of the mill MUA like mozilla/evolution. If at first you don't succeed, google for a solution!

    /pointer
  • I run offlineimap from cron on a host at home to keep a backup copy of my mail. It maintains a maildir hierarchy of all my IMAP folders. Setup was quite stratightforward and took me about five minutes. In a word, offlineimap rules !

    http://gopher.quux.org:70/devel/offlineimap/

    And it is available in Debian.

  • In my endless pursuit for a decent IMAP client on Windoze (still using Eudora 4), I found a beautiful bug in The Bat!'s IMAP support - it treated IMAP as just another protocol to download the mail like POP and then happily cleared it from the server! :( - RR [Feel free to mod humorous]
  • Hi. I asked this question.

    I managed to make a backup to local folders using Mulberry. Mozilla and Evolution, as suggested by several posters, simply wouldn't let me drag and drop a folder onto another. Mozilla would create an empty folder tree and copy INBOX. Evolution displayed its "you can't do this" cursor and produced an error message basically saying "you can't do this."

Crazee Edeee, his prices are INSANE!!!

Working...