procmail
[Top] [All Lists]

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

1998-10-19 14:34:33
On Fri, 16 Oct 1998 15:05:26 +0000,
Darren Wyn Rees <merlin(_at_)A470(_dot_)demon(_dot_)co(_dot_)uk> wrote:
An example of what I would like to delete:
the single line email with "unsubscribe" in it.

You don't need scoring for that.

    :0B
    * ^^unsubscribe^^
    /dev/null

Procmail can match on more than one line (see $ in the part of the
documentation which describes the regex extensions) but the hard part
is really solving the general problem of stripping .signatures etc
before matching. So you may be better off using scoring after all.

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

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

Another thing to deal with is the frequent misspellings of the word
"unsubscribe". You often see "ubsubscribe", "unsuscribe",
"unsubscirbe" etc ad naus.

/* era */

-- 
Bot Bait: It shouldn't even matter whether  (`')  Just  (`')  http://www.iki
I am a resident of the State of Washington   \/ Married! \/   .fi/~era/