procmail
[Top] [All Lists]

Re: Proper use of W flag

2003-10-16 11:19:31
In your message dated Thu, 16 Oct 2003 13:04:29 -0400, R A Lichtensteiger
said that ...

Thanks for the quick reply

Tim Rice wrote:

<> I originally thought adding a W flag would help avoid conflicts if two
<> users accessed the whitelist at the same time, but now I'm not sure using
<> "W" is correct.

If your users' access is read-only, then no need for any access
control to the file ...

Thank you, that makes sense.

<> This is how I'm using it:
<> 
<> # Deliver Whitelist addresses
<> 
<> :0 W
<> * ?formail -x"From:" -x"Sender:" \
<>   -x"Reply-To:" -x"Return-Path:" \
<> | egrep -is -f $HOME/whitelist
<> {          
<>    :0 hif
<>    | formail -A"X-Puremail: Global Whitelist"
<>    
<>     :0 :
<>     $DELIVER
<> } 

I don't think you don't need the "W" flag on the outside recipe:
Asking to test against the error code on the condition pretty much
covers it.

On the other hand, you may want to consider using "w" on the filtering
recipe inside the braces rather than "i" -- in either case a failure
means unfiltered header (ie., w/o comment) gets passed to the next
recipe, but you may want to log that happening, because it shouldn't
unless you have a problem on the server ...

You might also consider using fgrep (or grep -F; same diff) and not
egrep.  egrep is primed to deal with regex patterns, whereas you are
handing it fixed strings -- the very definition of fgrep.

Thanks for all the help and information, much appreciated.

-- 
Best Regards,

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


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