procmail
[Top] [All Lists]

Re: help on weighted scoring

1998-09-29 13:12:02
Darren Wyn Rees wrote,

| I'd like to start learning how to use scoring by using a non-default
| .procmailrc to process my 'bulkmail' folder to eliminate spam.  How can
| I create a recipe which ... says if the subject contains "$$$" add 100 to
| the score,

Dollar signs are tricky.  Unescaped as the first character, it is the
expansion modifier.  Unescaped without the expansion modifier, it matches
a newline (hard or putative).  Unescaped with the expansion modifier, it
starts a variable name [if the next character is legal in the name of a
variable].  Escaped with the modifier, it can mean a newline again.  Escaped
without the modifier, triple-escaped with it, or in brackets, it matches a
dollar sign.

To guarantee literal interpretation to match a dollar sign in the text,
use   [$]  .  To guarantee interpretation to match a newline, use  ($)  .
Those work as I just described whether the expansion modifier is on the
condition or not.

 * 100^0 ^Subject:.*[$][$][$]

| If the total score is 1000,
| delete it else put it in my default folder etc.

 :0 flags
 * other conditions
 * -999^1
 /dev/null # if score was greater than 999
 :0E:
 $DEFAULT

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