procmail
[Top] [All Lists]

Re: Well, that was interesting...

1996-10-30 14:49:52
However, this morning I managed to find the straw that broke the
camel's back. I added one more site to my recipe that recognizes
flush-on-sight spam-havens, and in so doing exceeded the upper bound
on the size of the match string. 

You should set LINEBUF to a big number; by default it is 2048.
At the top of your recipe (at least before the huge recipe below), do

    LINEBUF=8000

Easy fix, though. I split the recipe into two half-size recipies with
identical actions, and all is back to being well. 

Splitting the recipes avoids having any one regexp expression exceed
LINEBUF. 


Another solution is to place all of the regexps into a file (for
example, called "spamsters"), and use an egrep against the possible
source addresses:

    :0:spamsters.lock
    * ? formail -xFrom -xFrom: -xReply-To: -xSender | \
        egrep -s -f spamsters
    | $FLUSHFILTER $LIST > /dev/null

The "formail" pulls out the possible source addresses, and the patterns
in the "spamsters" file are matched against the addresses.  If the egrep
succeeds, then FLUSHFILTER is run.

This has the advantage that a spamster address occuring on any of the
source mail fields in the mail will can trigger a match, and not just
the From or From: headers.

Also, by keeping the spamster addresses in a separate file, you keep
your filtering separate from the file maintenance.

To update the file, you may wish to observe the following convention:

    lockfile spamsters.lock
    # update the spamsters file
    rm -f spamsters.lock

G'luck.
___________________________________________________________
Alan Stebbens <aks(_at_)sgi(_dot_)com>      http://reality.sgi.com/aks

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