The below procmail recipe <.rblrc> is used to let me know if an email I have
recieved is on a RBL. Since I have switched to qmail I notice that in my
procmail log that there are some IP's that are on the RBL's but they are
not being tagged by formail and being placed in my junkmail folder. I am
also noticing that the origip.pl script is also catching 127.0.0.1 as
the mail server. Being a newbee to qmail I am kinda at a loss.
TIA
<the perl script that gets the IP is origip.pl attatched below>
Contents of .rblrc
========================================================================
# Please check if all the paths in PATH are reachable, remove the ones that
# are not.
SHELL=/bin/sh
PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:/usr/include:/usr/local/sbin:/bin:/sbin:/usr/sbin:.
MAILDIR=$HOME/Mail
DEFAULT=$MAILDIR/Mailbox
PMDIR=$HOME/.procmail
JFDIR=$HOME/.procmail/junkfilter
LOGFILE=$PMDIR/log
LOGABSTRACT=all
VERBOSE=no
#LOCKFILE=$HOME/.lockmail
##
## RBL Check
##
:0
* TCPREMOTEIP ?? .
* ! ? rblcheck -q -s dul.maps.vix.com "$TCPREMOTEIP"
{
LOGABSTRACT=all
LOG="Filter: RBL-filtered address: \"$TCPREMOTEIP\"
"
:0:
|formail -i "X-RBL-Filtered-Address: $TCPREMOTEIP is in DUL."
}
:0
* TCPREMOTEIP ?? .
* ! ? rblcheck -q -s rbl.maps.vix.com "$TCPREMOTEIP"
{
LOGABSTRACT=all
LOG="Filter: RBL-filtered address: \"$TCPREMOTEIP\"
"
:0:
|formail -i "X-RBL-Filtered-Address: $TCPREMOTEIP is in RBL."
}
:0
* TCPREMOTEIP ?? .
* ! ? rblcheck -q -s relays.radparker.com "$TCPREMOTEIP"
{
LOGABSTRACT=all
LOG="Filter: RBL-filtered address: \"$TCPREMOTEIP\"
"
:0:
|formail -i "X-RBL-Filtered-Address: $TCPREMOTEIP is in RRSS."
}
:0
* TCPREMOTEIP ?? .
* ! ? rblcheck -q -s relays.orbs.org "$TCPREMOTEIP"
{
LOGABSTRACT=all
LOG="Filter: RBL-filtered address: \"$TCPREMOTEIP\"
"
:0:
|formail -i "X-RBL-Filtered-Address: $TCPREMOTEIP is in ORBS."
}
#
# If an X-reject: header is found in the message after consulting
# the lists, redirect the email to junkmail folder for later checking.
#
:0
* 1^1 ^X-RBL-Filtered-Address:
junkmail
# Catches everything else.
:0
$DEFAULT
# Anything that has not been delivered by now will go to $DEFAULT
# using LOCKFILE=$DEFAULT$LOCKEXT
====================================================================
Contents of origip.pl:
#!/usr/bin/perl
# Specifically for pulling the remote IP address out of Sendmail
# Received: headers. Supplied by Ophir Ronen <ophir(_at_)internap(_dot_)com>,
# ever-so-slightly modified by Edward S. Marshall
<emarshal(_at_)logic(_dot_)net>.
#
# $Id: origip.pl,v 1.1.1.1 1998/01/09 20:42:50 emarshal Exp $
#
# $Log: origip.pl,v $
# Revision 1.1.1.1 1998/01/09 20:42:50 emarshal
# Initial import into CVS.
#
@msg = <STDIN>;
foreach $line ( @msg )
{
chop $line;
if( $line =~ /.*\[(\d+.*)\]/ )
{
$REMOTEIP = $1;
last;
}
}
print STDOUT ( $REMOTEIP );
--
-------------------------------------------------------------------
Ron Rosson ... and a UNIX user said ...
The InSaNe One rm -rf *
insane(_at_)oneinsane(_dot_)net and all was null and void
-------------------------------------------------------------------
Today I will gladly share my experience and advice, for there are no
sweeter words than "I told you so."