procmail
[Top] [All Lists]

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

2005-08-20 10:04:20
On Sat, 20 Aug 2005 22:38:50 +0700 
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE was sent
the following email

Hello everyone,

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.

:0 
* ?formail -x"From:" -x"Sender:" \ 
  -x"Reply-To:" -x"Return-Path:" \ 
| fgrep -is -f $HOME/whitelist 
{  
         
      :0 hif 
      | formail -A"X-Puremail: Global Whitelist" 
} 
 
:0
*


^To:.*(feedback|malaysia|maldives|myanmar|phuket|samui|seychelles|singapore|sri-lanka)
* ! ^X-Puremail: Global Whitelist
* ! ^From:.*(seal|phuket|siam)
{          

      :0 hicw:
      | (formail -r -z -iFrom: \
        -xFrom: >> $HOME/whitelist)
}

It's now starting to look like an error on the ^To line. Is there a limit
to the line length in Procmail?

I'm going to try breaking the To line into two lines and see if that helps. 





-- 
Best Regards,

Tim Rice
---------------
Phuket Thailand




____________________________________________________________
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