I have an email account called "orders" at RoyalPetSupplies . com
The emails are stored in /var/spool/imap/users/orders/ and are numeric files
for each email message. (ex. "523.", "623.")
I need to extract all attachments sent (either "quoted-printable" OR
"base64" OR whatever) to a directory called "/mnt/smb".
I have spent over 2 days working on this, and can not create a suitable
solution. I have tried to use procmail, formail and
mimencode/uudecode/uudeview but can not create a recipe that will process
just the attachments to that directory. Any help??? A sample recipe, and/or
any advice (with web URLs preffered) would be great. Thanks.
>The emails are stored in /var/spool/imap/users/orders/ and are numeric
>files for each email message. (ex. "523.", "623.")
>
>I need to extract all attachments sent (either "quoted-printable" OR
>"base64" OR whatever) to a directory called "/mnt/smb".
at the simplest:
munpack -C /mnt/smb /var/spool/imap/users/orders/[0-9]*.
you probably need a way to prevent yourself from decoding a message twice,
e.g.,
[warning: untested]
header="X-Decoded-By-Us: foo"
for f in /var/spool/imap/users/orders/[0-9]*.
do
grep -q "^${header}" ${f} && continue
formail -i"${header}" ${f} > ${f}tmp || continue
munpack -q -C /mnt/smb $f && cat ${f}tmp > ${f}
rm -f ${f}tmp
done
--
bringing you boring signatures for 17 years
Maybe something like this?
# ------------------------------------
# throw away win attachments.
#
# we...@gmx.li and procmail mailing list, 3May2001.
#
:0 HB
* -1^0
* 1^0 ^Content-Disposition: attachment;
* 1^0 filename=".*\.(exe|com|bat|hta|lnk|mdb|mus|pif|scr|vbs|wav)"
{
:0
{ RULE="Windows Attachments" }
:0
/dev/null
}
And see the procmail-users mailing list archives.
--
Any technology distinguishable from magic is insufficiently advanced.
(*) TopQuark Software & Services. Contract programmer, server bum.
- - Give up Spammers; I use procmail.
How to quote: http://learn.to/quote (Ger.) http://quote.6x.to (Eng.)