Jump to content

Utility for harvesting email attachments


ramfree17
 Share

Recommended Posts

anybody know of a utility/script that can harvest the attachments from a mbox file? my highschool friends are sending me scanned pix for our reunion this coming year for collation and it is tedious to save then one by one. sylpheed-claws has a save-all functionality but it is still tedious to open each message one by one.

 

i am hoping for something that i will just feed the mail file to and it will traverse it and save the attachments in a directory.

 

thanks.

 

ciao!

Link to comment
Share on other sites

You are lucky man! there is a tool named 'uudeview' that does just what you want. You can feed it with your whole user's spool file or even with all the mailboxes at once.

 

just an example:

~$ uudeview -i +o +a -p ~/tmp/ /var/spool/mail/$USER
Found 'alaska 119email.jpg' State 16 Base64 Parts 1 OK
Found 'portada.pdf' State 16 Base64 Parts 1 OK
Found 'icestorm 010email.jpg' State 16 Base64 Parts 1 OK
Found 'portada.pdf' State 16 Base64 Parts 1 OK

   File successfully written to /home/aru/tmp/alaska 119email.jpg
   File successfully written to /home/aru/tmp/portada.pdf
   File successfully written to /home/aru/tmp/icestorm 010email.jpg
*** Target File /home/aru/tmp/portada.pdf exists - autorenamed to /home/aru/tmp/portada_1.pdf
   File successfully written to /home/aru/tmp/portada_1.pdf

~$

 

check the options on the man page

 

You can get uudeview from the contrib mirror.

 

HTH

 

[edited: now I've post the best way to call uudeview --IMHO-- (notice that when two attached files are found with the same name the later is renamed to not overwrite the former) see the man page to findout what the cmdline opts do]

Edited by aru
Link to comment
Share on other sites

thanks aru. i think that will work just fine. i wonder if there is a cygwin port so i can test it while im here in the office.

 

as for procmail, it was way above my range of thought. i even printed the whole faq so i can read it at home. i think it was made for loonixers like you. :twisted:

 

ciao!

 

[edit] google to the rescue!!!! -> http://www.fpx.de/fp/Software/UUDeview/

Edited by ramfree17
Link to comment
Share on other sites

as for procmail, [...] i think it was made for loonixers like you. :twisted:

:dry: bah! It deserves the effort, and it's not that hard, even for a near-a-decade-newbie like you! In five minutes (let's say 10 because of reading of man pages) you can do a nice combined script (bash - procmail - uudeview) to full automate the proccess and create whatever you are going to do with those pictures... and more important it will be more fun and cooler than doing in a demi-automatic way just using uudeview :deal: :mr-green:

Link to comment
Share on other sites

near-a-decade? where did you get an idea like that? :twisted:

 

oh, i spent more than 10 minutes on that. i think i devoted at least 5 hours reading the faq pages from iink.net and all it got me are a couple of simple recipes that doesnt want to work the way i want them to. i was using anon's server back then so when he reformatted it i also said good bye to procmail.

 

ciao!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...