procmail
[Top] [All Lists]

Re: Parse body but not attachment

2002-01-04 16:24:50
At 15:33 2002-01-04 -0600, Justin Shore wrote:
##  --  advertising.com
:0 BH
* advertising.com

It's a darn good thing you don't filter all your mail on this, or else THIS message (and YOURS as well) will be flagged as spam and stuffed into a file you wouldn't see.

The problem is (I believe) that procmail isn't only parsing the body (and headers in this example), it's also parsing my attachment.

As has been explained multiple times in this forum, ATTACHMENTS ARE MERELY ENCODINGS STUFFED INTO THE BODY. To an MTA (and the LDA), there is no "attachment", it's all merely the body.

That's what I need to stop. I would rather not say 'don't scan messages with attachments' because lately my spam has been both HTML & plain text and this would allow those spams around that recipe. I would rather say, if the message has a MIME-type attachment to ignore the attachment. Or something like that.

The MIME header (in the message headers) won't necessarily identify a FILE attachment - HTML and richtext email however would be flagged as a "mime-type attachment", which would defeat your purpose whenever the spew is sent as HTML (and an increasing amount is).

Further, to parse the message body looking for individual file attachments would require *MORE* cycles than looking for your simple match string, so, how about "don't perform this scan on messages larger than some size threshold" ? After all, it's the SIZE of the message that's killing you, not what it contains. If that works for you, add the following at the top of your conditions:

* $ < 400000

Basically, this would say "only perform the rest of the conditions if this message is less than 400000 bytes". See 'man procmailrc'

Adjust the value to taste - mass spams tend to be *MUCH* smaller than the figure I use as an example (there's the occasional twit who sends around DOC files of their marketing propaganda, but these aren't the mass spew sort).

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>