How can I save the attachments from 10000 emails?
November 6, 2008 1:47 PM   Subscribe

I have an IMAP email folder with about 10,000 messages. Each of the messages has a .jpg image attached. I want to save all of those images into a folder on my hard drive. Any ideas on the best way to do this?

I'm not adverse to writing a script to handle it (on any platform), if that's the quickest way to get the job done. But if there's some easy solution out there, like a particular mail client that has this functionality, all the better. The mail is stored on a linux Zimbra server on which I have root shell access, if I have to go the route of MIME decoding the messages on the file system.
posted by team lowkey to Computers & Internet (6 answers total) 3 users marked this as a favorite
 
Best answer: mutt can tag multiple mail and perform operations on them; you can look at whether some suggested mutt macros will do the job for you.
posted by rodgerd at 1:52 PM on November 6, 2008


Best answer: Another easy approach would be to save all the messages to a format like mbox or maildir (using any unix imap client like Pine, Mutt, etc.), and then run a tool that extracts attachments (I found ripMIME and mimedecode in a couple minutes of googling).
posted by hattifattener at 2:09 PM on November 6, 2008


Best answer: Oddball solution - grab an old copy of Eudora mail, and just download the messages.

Eudora automatically extracts and saves all attachments in an "Attachments" folder.
posted by TravellingDen at 3:26 PM on November 6, 2008


I was just clicking over to suggest TravellingDen's solution. I used Eudora for ten years before moving over to Apple Mail, and I'm still hunting for the attachments folder! The only problem may be that Eudora doesn't download IMAP attachments by default, but I'm pretty sure there's a setting you can change to force it to do so.
posted by harkin banks at 4:02 PM on November 6, 2008


Response by poster: I haven't used mutt in like 15 years, and just figuring out how to subscribe to an imap folder was proving too time consuming to make an attempt at then figuring out how to use macros. Moved on to finding a quicker solution.

I tried using Eudora, and found the attachments folder, so that seemed like a great solution... except it never managed to download the mail at all. Loaded my inbox, but none of the subfolders. So while that was failing, I tried something else.

It turns out there is a method in Zimbra that allows you to download an entire IMAP folder as a zip file. So I did that, and then looped ripMIME against all the messages. Done and done. Thanks for your help everyone.
posted by team lowkey at 6:20 PM on November 6, 2008


somewhere, (lifehacker?) I picked up something called outlook attachment stripper, which can do this for outlook. Sorry, can't google for it right now, and not at that machine.
posted by dripped at 2:37 AM on November 7, 2008 [1 favorite]


« Older Recommend a gentle alarm clock   |   How do I export Google Scholar results to Excel? Newer »
This thread is closed to new comments.