procmail
[Top] [All Lists]

Re: Your mail

2003-04-21 14:49:29
At 22:42 2003-04-21 +0200, Björn Lindström wrote:
:0
* ^X-Spam-Level: \*{7,}
/dev/null

As already explained, that regexp syntax is not supported by procmail. Some alternatives have been suggested, though I noted the most direct approach for using a numeric count was missed:

:0:
* ^X-Spam-Level: \/[*]+
* -6^0
* ^1^1 MATCH ?? (\*)
spam.mbx

This does the following:

Extracts the asterisks in the X-Spam-Level: header to the $MATCH variable. If there is no match, the recipe will stop there. Then, it assigns a -6 score value (one less than your limit), and then adds one point for each (^1) occurrence of * in the MATCH variable.

Note that I don't simply discard it - find if you want to purge the spam.mbx every so often, but simply shuttling the messages to /dev/null means that if something is improperly identified, you don't even have the option of going back to review it.


You should consider setting up a "sandbox" to test recipes in - it is much easier to do what-ifs and enable VERBOSE logging for a handful of test messages, than to subject your regular mail to something which may or may not work. The above recipe you provided, if in your mainline, could have just as easily had a syntax error in it which would have resulted in ALL OF YOUR EMAIL being shuttled to /dev/null. Not the place to test something, and you should ALWAYS endeavour to test a recipe before putting it into use on a live mail system.

---
 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>