Does anyone know of such a utility.
SCO 5.0.4 to 5.0.6, standard file format in /usr/spool/mail/xxxx
having been put in there by sendmail.
Better yet if the files can be decoded automatically as part of the
sendmail routing, but I've not had any success with the posted methods
of running sendmail to output via a script.
Iain Sharp
(Please e-mail as well, newsgroup access a tad spotty).
You might want to look into thigns like 'mimedecode' (or 'mdecode'). I
don't they are distributed as part of the SCO OS' by default, but they
should be available as part of Skunkware.
Failing them, look at 'mutt'.
bkx
Hi
I use this for all sorts of purposes.
1. Download the source of mpack/munpack and compile it
2. For each user xxxx either setup your script in their cron, or just
do it under root's cron. Something like the following:
User=xxxx
Work=/tmp/xxxx
[ -d $Work ] && mkdir $Work
cd $Work
while [ -s /usr/spool/mail/$User ]; do
# save message 1 and delete it
echo "save 1 .msg\nd1\nq" |
mail -u $User &&
munpack -q .msg
# do what you want with the message eg rm -f .msg
# do what you want with the extracted contents
done
Season the above to your taste ie permissions, timestamps, error
trapping, etc.
Enjoy
-Greg
... for the record, what we do is use uuencode, and a filter similar to:
---------------------------------------------------------------
#!/usr/bin/perl
$Export_Directory = "/usr/spool/uucppublic";
$File_Begin = 0;
while (<STDIN>) {
if (/^begin [0-7](?:[0-7]{2})? ([[:alnum:]\._-]+)/) {
$File_Begin = 1;
open( FILEHANDLE, "> $Export_Directory/$1");
}
if ($File_Begin) {
print FILEHANDLE unpack("u*", $_ );
if (/^end/) {
close( FILEHANDLE );
$File_Begin = 0;
}
}
}
---------------------------------------------------------------
set up as an alias (filedump: "| /usr/local/bin/filedump.filter") using
sendmail. Anything sent uuencoded to that address gets decoded automatically
and dumped.. But if you're receiving Mime messages, you'd have to make this
sort of routine more complex in order to grab out the file name from the
MIME header etc. etc.
bkx