procmail
[Top] [All Lists]

Re: external 'IP-Blacklist'

2004-02-02 13:07:42
On Mon, 02 Feb 2004 09:30:57 +0100, Michelle Konzack
<linux4michelle(_at_)freenet(_dot_)de> wrote:

Hello, 

I like to filter some incoming Mails bei Sender-IP, but I do 
not like to include the Bunch of IP's in my ~/.procmailrc.

I prefer to have a seperated ~/.procmailrc.blockIP

How can I do it ?



While I am not an expert in Procmail, here is how I did it, reading the
man pages and other resources,  and it works for me.

## Get the IP address from the Received line.
:0
* ^Received:.*\[\/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
 { TCPREMOTEIP=${MATCH} }


:0

* $TCPREMOTEIP??$IPBLACKLIST

 {
 LOG="Black Listed IP Address in the Received header$NL"
 :0
 $blacklisted
}


That is of course if the IP address is not already in an RBL.
For that, I use notespam.
http://www.xisp.net/notespam/

After installing it, I use the following.

##################
:0
* ^X-RBL-Check:\/.*
{
LOG="Open Relay-SPAMHaus: $MATCH$NL"

:0 fwH
|sed -e 's/^Subject:[   ]*/Subject: [RBL SPAM] /'

:0:
$RBL-Blocked
}


Hope this helps.



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