Dear Colin,
The URL is very useful. I managed to solve my problem no. 1 & 3 mentioned
earlier. But I still can't detect the JPEG format. Below is the code I have
modified from your original:
:0
* ^Content-type:.*image/jpeg
* HB ?? Content-transfer-encoding:.*(x-uuencode|base64)
{
LOCKFILE=munpack.lock
TMPDIR=/tmp/
FARGS=`sed -e
'/^Content-[Tt]ype:.*[Nn]ame=/s,[Tt]ext/,application/,' | \
munpack -C $TMPDIR 2>&1 | \
grep -v -e "reading from standard input" -e '^$SPC$' | \
sed -e "s,^,-A 'X-munpack-info: $TMPDIR/," -e "s/$/'/"`
:0 fhw
| eval formail $FARGS | cat
LOCKFILE
}
Do you see what is the problem? I still can't get things from the /tmp
directory.
Thanks,
Joe
-----Original Message-----
From: procmail-admin(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE
[mailto:procmail-admin(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE]On Behalf Of
Collin Park
Sent: Wednesday, September 06, 2000 3:57 AM
To: procmail(_at_)Lists(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: Newbie to ProcMail
"Joe Cheong" wrote:
1. How to detect that the message contain attachments?
2. How to know that these attachments are certain format, e.g.
PDF / JPEG
3. Can I save the few attachments onto the disk?
Here is a possible starting point:
http://MailMan.RWTH-Aachen.DE/pipermail/procmail/2000-June/000220.html
The recipe shown there detects attachments in base64 or uuencode,
saves them in a certain directory, puts the information about where
they were saved, etc.
You may want to modify it to only save certain attachments -- i.e.,
add to conditions "image/jpeg" or "\.pdf" or something like that.
cheers,
--
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.
Collin Park Not a statement of my employer.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail