procmail
[Top] [All Lists]

Re: Using a list of known good senders

2002-05-06 09:25:12
On Sun, 5 May 2002, Chuck Charlton wrote:

CC> I have a .procmailrc that is working well.  I would like to add a
CC> recipe that checks the From: address and compares it to a list of
CC> email addresses that I am willing to receive mail from without
CC> further processing.  What is the recipe, and what is the right
CC> way to include the file?  I'm envisioning a text file with one
CC> email address per line, but I'll go with whatever works best.
CC>
CC> Thanks.
CC>


I store the from: header in a variable because I use it more than once:

# FROMHEADER is Reply-To or From:
: 0 hw
FROMHEADER=| formail -c -rtz -x To:


Then use (for a negative check):

#### is it not in the whitelist?
:0
* $ ! ? echo ${FROMHEADER} | grep -F -isx -f $PMDIR/list.white
{


So I guess you would need (without checking the syntax:

:0:
* $  ? echo ${FROMHEADER} | grep -F -isx -f $PMDIR/list.white
${DEFAULT}



Make sure your list.white isn't an empty file or grep gets upset.

echo >  list.white

should create a non-empty file before you put any addresses in it.

The file is simply one address per line:

KioM381912(_at_)msn(_dot_)com
khs5756(_at_)lycos(_dot_)co(_dot_)kr
mail(_at_)dhs-club(_dot_)com


As you are using Pine, you might be interested in my script for a sending
filter for Pine, which allows you to add the recipients of mail you send
to the white list.


Alan



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