procmail
[Top] [All Lists]

Re: filtering by IP address

2002-02-20 00:55:58
On Mon, Feb 18, 2002 at 05:51:24PM +0000, Pollywog wrote:
Is there another set of Procmail recipes that allows me to have a list of 
spammer IP blocks so that mail from those networks is either tagged or 
sent to /dev/null ?

I wouldn't recommend sending to /dev/null unless you've preceded the recipe
with diversions for family and friends.

There are two basic approaches that I use for filtering based on IP addresses
in the headers: regular expression in an rc file and list of IPs that external
egrep uses.

The first is for IPs which have spammed me personally, and goes:
:0:
* ^(From.|Reply-To:|Message-ID:|Received:).*[^0-9a-z](\
 202\.(5\.131|67\.178|96\.|97\.220|98\.(47|166)|99\.26)|\
 202\.(100\.209|102\.2[0-9]|103\.134|104\.85|106\.186|108\.44|163\.202)|\
---- 50 some lines abbreviated ----
 235\.107\.22)
$SPAMFILE

The second is a composite of publicly available blacklists, and goes:
:1
? /usr/bin/fgrep -i -f /usr/local/share/procmail/badips
$SPAMFILE

The file "/usr/local/share/procmail/badips" is simply a list of IPs.

If anyone knows how to combine these two strategies into one recipe, I'm
open ears.

henry nelson
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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