At 01:02 PM 6.9.2004 -0700, multimedia-fan(_at_)myrealbox(_dot_)com wrote:
Can someone please explain why the following doesn't work?
I am trying to white list email from some domains ( I know, not the best
way to do it, but after I scan for virus and other things, I have to
white list based on some domains), and here is what I am trying to do.
Looking at some of the recommendations here
http://www.professional.org/procmail/sandbox.html (Thank you Sean)
I have done the following.
# Get the From: address as an address component only
:0 h
CLEANFROM=|formail -IReply-To: -rtzxTo:
# Get the domain portion
:0
* CLEANFROM ?? @\/.*
{
FROM_DOMAIN=$MATCH
}
# Now that we have the domain of the sender test it against a list of
#domains, domainwhitelist
:0
* FROM_DOMAIN ?? $FGREP -iqf $domainwhitelist
{
LOG="Sender is from a whitelisted domain :$FROM_DOMAIN$NL"
:0:
FromWhitelistedDomain
}
This works for me on blacklists -- should be same for whitelist:
## Blacklist emails FROM
:0 w:
#* ? $FORMAIL -x"From" -x"From:" | $EGREP -i -f $BLACKLIST1
* ? formail -x"From" -x"From:" | $EGREP -i -f $BLACKLIST1
#* ? $FROM | $EGREP -i -f $BLACKLIST1
$BOX
## Blacklist emails TO
:0 w:
* ? formail -x"To" -x"To:" | $EGREP -i -f $BLACKLIST2
#* ? $FORMAIL -x"To" -x"To:" | $EGREP -i -f $BLACKLIST2
#* ? $TO | $EGREP -i -f $BLACKLIST2
$BOX
Best regards,
Jack L. Stone,
Administrator
Sage American
http://www.sage-american.com
jacks(_at_)sage-american(_dot_)com
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail