Re: [Exim] Filter Help

Top Page
Delete this message
Reply to this message
Author: Giuliano Gavazzi
Date:  
To: Marc Perkel, exim-users
Subject: Re: [Exim] Filter Help
At 11:01 -0800 2002/12/16, Marc Perkel wrote:
>Just to understand this fully ....
>
>${if match{$h_from}{^From:\s*(.*)\s*<}{$1}{ what i'm matching goes here? }}
>
>as in
>
>${if match{$h_from}{^From:\s*(.*)\s*<}{$1}{
>${readfile{/etc/exim/blockbyname}{|}} }}
>
>????
>
>Is that it?


no, the last set of braces is what my expression returns in case
there is no match. In case of success it instead evaluates to
(returns) $1, that's in turn the expression that matched the (.*).
In other words, $1 is the "Marc Perkel" string.

So, my whole expression (as in my email), must be used as the key
your are looking up in yout blockbyname file. I would not read the
blockbyname file and do a match on it, because it's extremely
expensive.
I would rather do a dbm (or whatever) file, and use the result of my
expression, the full name, as a lookup key. You could probably even
use the return value, say 1 or 0, to decide if to block. That way you
could make your database a black/white list.

Giuliano
--
H U M P H
    || |||
  software


Java & C++ Server/Client/Human Interface applications on MacOS - MacOS X
http://www.humph.com/