<<< Date Index >>>     <<< Thread Index >>>

Re: attachments: save all



Pablo --

I wonder if you still need this even though it's now been a few days...

...and then Pablo Hoertner said...
% 
% dear list!
% 
% i just received a mail with lots of fonts attached. can i somehow tell mutt 
to 
% save everything into a folder with just one command/short-cut?

I have posted my wmunpack script a couple of times before; it changes to
a landing directory, sets the umask to readable, and pipes the message
through munpack to spit out the attachments.  [Sorry, but it doesn't
change any names.]

I typically use it to extract some picture or word doc sent to me, so my
usage is

  |wmunpack
  |wmunpack -d
  |wmunpack -t subdirname

where the first dumps in my default tmp directory, the second in my
default docs directory, and the third makes subdirname under my tmp dir
and puts things there.

As an added bonus, I've recently tweaked it to display a url for each
thing it extracts, so here it is again.


% 
% best regards,
% pablo


HTH & HAND

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) davidtg@xxxxxxxxxxxxxxx * society and not sufficient moral courage.
(work) davidtgwork@xxxxxxxxxxxxxxx  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

#!/bin/sh
# quickie to munpack from email to web dir

WWW=/your/drop/dir
URL=http://example.com/path/to/your/drop/dir
DIR=tmp

case "$1" in
  -p ) DIR=pix ;;
  -d ) DIR=doc ;;
  *  ) DIR=tmp ;;
esac

URL=$URL$DIR

umask 022
[ -d $WWW/$DIR ] || mkdir -p $WWW/$DIR
cd $WWW/$DIR
[ -n "$2" ] && { mkdir -p $2 && cd $2 ; URL=$URL/$2 ; }

for i in ` munpack `
do
  echo "$URL/$i"
done

Attachment: pgpc8UzZIadEE.pgp
Description: PGP signature