procmail
[Top] [All Lists]

Re: possibly dumb question -- multiple items on single line getting scored

1996-12-05 13:42:45
Robert Brown asked,

| I'd like to filter out those spam messages with '$' in their subject and in
| the body, but only if there are more than two of them.
| 
| My question is this: if someone sends a message with
| 
| Subject: $$$ You are a fool $$$
| 
| and I do this:
| 
| :0H
| *-1^0
| *1^1 \$
| /dev/null
| 
| will this message [correctly] get trashed?

A weighted egrep recipe counts non-overlapping appearances of the regexp.
If you mean that you want to count every dollar sign separately, you did it
right.  If you wanted to count every line that contains a dollar sign as one
occurrence, you'd need code like this:

  :0B
  * -1^0
  * 1^0 H ?? ^Subject:.*\$
  * 1^1 ^.*\$.*$
  /dev/null

I hope your question gives just an example, though; it's very possible that
someone may send you mail discussing the price of or the pay for something 
in which you're legitimately interested (you might even be the one who ini-
tiated the discussion) and use two or more dollar signs in the body.

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