procmail
[Top] [All Lists]

Re: Reverting back to a simple blacklist

2004-11-07 23:18:32
* Poohba <poohba(_at_)blkpoohba(_dot_)dyndns(_dot_)org> :
I figured I would create a script to read from my blacklist mail folder
and get the 'From:' email addresses and move them to my
/home/user/.killfile.  So now I need to get my old blacklist working
again.  I've tried the following but too much mail goes to the trash
that shouldn't.  I am glad I have it going to trash instead of /dev/null
but how do I get this to only put in the trash those emails that have a
From: header or Reply-To: header that matches whats in the $BLACKLIST ? 
I had 'Reply-To:' in the recipe also but took it out.

BLACKLIST=$HOME/.killfile
:0
*$ ? test -s $BLACKLIST
* ? (formail -x From: | fgrep -iqf $BLACKLIST)
trash

and 

BLACKLIST=$HOME/.killfile
:0
*$ ? test -s $BLACKLIST
* ? (formail -x From: -x Received: | fgrep -iqf $BLACKLIST)
trash

I use :

:0:
* ^(From:|Sender:|Reply-to:|Return-Path:)\
.*\/[A-Za-z0-9_(_dot_)+-]+(_at_)[A-Za-z0-9_(_dot_)+-]+
* ? grep -i "$MATCH" $BLACKLIST
$BLACK

You can add or remove whatever headers in the second line you like.
$BLACK=/dev/null for me, but for testing you could make it 'trash'.

-- 
T R O Y  P I G G I N S
e : troy(_at_)piggo(_dot_)com

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>