procmail
[Top] [All Lists]

Re: Whitelists without grep? (file)

2003-03-12 12:36:47
On Sun, Mar 09, 2003 at 03:49:46PM +0100, poff(_at_)sixbit(_dot_)org wrote:

I use various "whitelists" but I want to know how to filter them without
using egrep like:

:0:
* ? egrep -i "$DOMAIN" .sdfdoms
"sdf'ers"

If it was just one domain that would be ok, but it's a list of them
separated by \n

I use this all the time:

        :0
        * ^From:[^(_at_)]+@\/[a-z0-9.-]+
        * ? grep -qi "^$MATCH$" $HOME/.whitelist
        { whitelisted=yes }

But if the goal is to avoid the regexp parsing, use grep's -F option.
Purists will tell you to use fgrep instead of -F.  :)  You could do a
more approximate whitelist like this:

        :0
        * ? grep -qiFf $HOME/.whitelist
        { whitelisted=yes }

which would look for any of the whitelisted domains anywhere in the
headers of your email.  This would be prone to false hits.

But it sounds like what you're doing is a combination of whitelisting
and smart filtering.  If what you really want is not to whitelist, but
to save list messages to a folder, you should use a single recipe that
matches common headers that identify the list, rather than relying on
domains in the From address.

-- 
  Paul Chvostek                                             
<paul(_at_)it(_dot_)ca>
  Operations / Abuse / Whatever
  it.canada, hosting and development                   http://www.it.ca/


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