procmail
[Top] [All Lists]

Re: filtering by IP address

2002-02-20 04:52:32
Hello,

Nelson Henry Eric <nelsonhe(_at_)nara(_dot_)kindai(_dot_)ac(_dot_)jp> wrote:

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.

Try this:

:0
* ? formail -x"From" -x"From:" -x"Sender:" \
    -x"Reply-To:" -x"Return-Path:" \
    | egrep -is -f /usr/local/share/procmail/badips
Spamfile

Regards,
James Tsay at Mintac.com

_______________________________________________
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>