Using SORBS with PROCMAIL.
This is one of the many receipes....
# First, get the originating IP using the origip.pl script
TCPREMOTEIP=`origip.pl || echo 127.0.0.1`

:0
* ! ? if [ -n "$TCPREMOTEIP" ]; then rblcheck -q -s dnsbl.sorbs.net "$TCPREMOTEIP"; fi
{
:0 fhw
| formail -A "X-Suspected-Spam: RBL - BLOCKED - dnsbl.sorbs.net"

:0:
# Choose one of the three following.
$SPAMBOX
# $DEFAULT
# $NULL
}
You will also need the following perl script (origip.pl):
#!/usr/bin/perl
# Specifically for pulling the remote IP address out of Sendmail
# Received: headers. Supplied by Ophir Ronen ,
# ever-so-slightly modified by Edward S. Marshall .
# $Id: procmail.source 3164 2014-01-07 12:31:37Z michelle $
# $Log: procmail.source,v $
# Revision 1.1.1.1  2004/04/30 01:06:53  stuart
# Intial import of dnsbl.sorbs.net into CVS
#
#
# Revision 1.1.1.1 1998/01/09 20:42:50 emarshal
# Initial import into CVS.
@msg = ;

foreach $line ( @msg )
{
	chop $line;

	if( $line =~ /.*\[(\d+.*)\]/ )
	{
		$REMOTEIP = $1;
		last;
	}
}
print STDOUT ( $REMOTEIP );


Thanks to delisle -at- eskimo.com for the pointer.

 
   
Copyright © 2002-2014 by SORBS | Terms & Conditions | Privacy Policy