procmail
[Top] [All Lists]

Re: Check whitelist file and if not there add to whitelist

2005-08-20 12:54:07
On Sat, Aug 20, 2005 at 11:54:25PM +0700, Tim Rice wrote:

I cant figure out why this isn't working. I want to check the
existing whitelist and if the address is already there, add a
X-Puremail Tag to the mail.

Then check to see if it's To: our web forms, not From: us and
not already in the whistlist using the X-Puremail tag.

What is happening is ALL mail is getting the X-puremail tag
and added to the whitelist regardless of the To, From, or
X-puremail tag checks.

The problem seems to be in the top recipe but I cant figure out
why.  Any help would be appreciated.


Well, what do the verbose logs say?


:0 
* ?formail -x"From:" -x"Sender:" \ 
  -x"Reply-To:" -x"Return-Path:" \ 
| fgrep -is -f $HOME/whitelist 


That is rather nonsense, I'm afraid, Tim.  :-(

First of all, the formail statement gives multi-word output.  Then,
the fgrep statement seems bogus.  Here:

 9:46pm [~/Mail] 677[1]> formail -x"From:" -x"Sender:" \
        -x"Reply-To:" -x"Return-Path:" < $SPAMPLE \
      | fgrep -is -f ~/.login

 <Danielsijie(_at_)wanadoo(_dot_)fr>
 "Carrie Becquart" <Danielsijie(_at_)wanadoo(_dot_)fr>

What is that spammer's forged header information doing in my .login? :-)
(Hint: it's not there.  So your fgrep syntax is messed up.)

I'd test the syntax in the shell before trying to stuff it into
procmail.

Dallman

____________________________________________________________
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