I want to modify my mail server (RedHat 6.2) so that any incoming mail
for
users on my system will be checked against a list of blocked addresses
for
that user. What is the easiest way to go about this? Should I setup a
server-wide procmail recipe that will refer to a file of blocked
addresses
within the users home directory?
Something like:
# Blacklist lookup
# (Recipe is executed if exit code is 0)
# (Solaris 2.7 grep does not have "-f patternfile")
BLACKLIST=somefile
:0
* ! BOUNCE_NOUSER_EXITCODE ?? 1
* $ ? test -f $BLACKLIST \
&& (formail -zxFrom: -zxReply-To: -zx"From " | egrep -i -f
$BLACKLIST)
{ BOUNCE_NOUSER_EXITCODE=1 }
taylor to your needs. It is not totally reliable as the sender can't be
determined reliably (as usual).
Volker
I have tried this method, but for some reason it is still delivering the
mail to the user even though the sending email address is in the BLACKLIST
file. Below is a snippet from my procmail log file. Can anyone offer some
suggestions? Thanks a lot.
procmail: Match on "^From: "Nathan Martinez" <nathanm(_at_)aaesys(_dot_)com>"
procmail: Assigning "BLACKLIST=Banned_User_List"
procmail: Match on ! "1"
procmail: Executing " test -f Banned_User_List &&
(formail -zxFrom: -zxReply-To:
-zxFrom | egrep -i -f Banned_User_List)"
procmail: [18631] Mon Oct 2 16:09:12 2000
procmail: Match on " test -f Banned_User_List &&
(formail -zxFrom: -zxReply-To:
-zxFrom | egrep -i -f Banned_User_List)"
procmail: Assigning "BOUNCE_NOUSER_EXITCODE=1"
procmail: Locking "/var/spool/mail/admin.lock"
procmail: Assigning "LASTFOLDER=/var/spool/mail/admin"
procmail: Opening "/var/spool/mail/admin"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/spool/mail/admin.lock"
From nathanm(_at_)aaesys(_dot_)com Mon Oct 2 16:09:11 2000
Subject: blah
Folder: /var/spool/mail/admin
850
procmail: Notified comsat: "admin(_at_)4256:/var/spool/mail/admin"
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail