procmail
[Top] [All Lists]

Re: filtering "uns*bscribe"-type requests etc.

1998-10-19 16:08:07
Era Eriksson wrote,

|     :0B
|     *      ^^( |$)*unsubscribe$
|     *  6^0
|     * -1^1 $

Those conditions will never match for any message.  Either the unweighted
condition will fail, or "$" will be matched again and again to the opening
putative newline until the score falls to infemum.

| This will not enter the scoring part unless the first non-blank line
| of the message contains only the word "unsubscribe" (with optional
| whitespace). Then, it will start out with a score of six which
| decreases by one for each end of line encountered. (This is untested.
| David will no doubt have to comment :-)

Oh, yes, I do.  You want to match on messages where the first non-blank
thing in the body is "unsubscribe" at the end of a line, where there are
five lines or fewer in the body?

 :0B  other flags
 * ^^( |        |$)*unsubscribe$
 * 7^0
 * -1^1 ^.*$
 action

^.*$ always counts one line too many, so a five-line body will be counted as
six; that's why we need a prejudice of 7.

But if the first non-blank text in the body is "unsubscribe" alone on a line,
is a line count really necessary?  True posts that include the word will have
it in the middle of a sentence, such as the preceding one.  What you'll find
by specifying a line limit is that unsubscribe requests with long signatures
or attachments at the bottom of a previous message will get through.