procmail
[Top] [All Lists]

Re: Problem checking against a whitelist/blacklist

2001-11-25 08:55:41
Louis LeBlanc is having trouble with this and a similar recipe (long
lines split, hopefully for readability):

| :0Bfhw
| * ? formail -x From:  -x Sender:  -x Reply-To:  -x Return-Path:  \
|     -x To:  | egrep -is -f /home/leblanc/.mutt/whitelist \
|     | formail -Y -f -A "X-Whitelist: keep it
| :0A
| { WHITE=YES }
| 

even though they should apprently match:

| 
| $ egrep -is -f ~/.mutt/whitelist testheader.txt 
| From: Louis LeBlanc <leblanc(_at_)keyslapper(_dot_)org>
| 

Maybe I'm missing something, but you don't have any action here. The
final part of your pipeline, appending the X-Whitelist: header, would
seem to be the problem. You're not passing the headers to formail at
that point. You're passing the output from egrep. That's probably
what's failing, but even if it didn't you're not passing any output from
the recipe. You're just slurping the input, checking success, and
outputting nothing. The first two parts of your pipeline should be the
condition, and the third should be the action. I don't have time to try
it, but I think you'd want something like:

:0fhw
* ? formail -x From: -x Sender: -x Reply-To: -x Return-Path:  \
            -x To: | egrep -is -f /home/leblanc/.mutt/whitelist
| formail -Y -f -A "X-Whitelist: keep it"
:0A
{ WHITE=YES }

I omitted the "B" flag because it doesn't seem necessary unless there's
more to this than we can see. And you were missing the closing
double quote on the final formail -A command, but that might have
been a cut 'n paste faux pas. Also, I'm not sure about the -s option to
egrep here, but that's your call. It also appears that grep would be
sufficient.

-- 
Reply to list please, or append "6" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail