procmail
[Top] [All Lists]

Re: Newbie Question - Whitelist Howto?

2009-06-06 22:23:01
At 17:31 2009-06-06 -0600, LuKreme wrote:

# we require a trailing space or tab after the address match, whether an
# mbox is specified or not.
ISLISTED=`grep -i "^$CLEANFROM " $WHITELIST`

Seems that using:

CLEANFRMRE=$\CLEANFROM
ISLISTED=`egrep -i "^$CLEANFRMRE([      ]|$)" $WHITELIST

Would obliviate the need to have trailing whitespace - either there's a separating space or tab, or there's an EOL. I would think that doing this would be preferrable since tracking down that one address that doesn't have a trailing whitespace can be a bugger when you don't _see_ the whitespace in the typical editor.

There's two other significant changes here as well: I'm using the "escape the regexp elements in the variable" syntax - so DOTS in the address are escaped, rather than interpreted as regexp wildcards, though since that is a procmail syntax, not a shell, I assign the escapement to another variable to use within the shell operation, and I also anchor the address to the start of the line (ensuring that we don't match "smith(_at_)example(_dot_)com" to "fred(_dot_)smith(_at_)example(_dot_)com" in the file).

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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