Re: [Exim] Filter Help

Top Page
Delete this message
Reply to this message
Author: Marc Perkel
Date:  
To: Giuliano Gavazzi, exim-users
Subject: Re: [Exim] Filter Help
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?

Giuliano Gavazzi wrote:

> At 8:03 -0800 2002/12/16, Marc Perkel wrote:
>
>> OK - got your other message.
>>
>> That didn't quite do it unless I'm missing something. What I want to
>> do is to take the email address and separate the name out and
>> compare the name part to a list of prohibited names for spam control.
>>
>> So - we start with a from address like:
>>
>> Marc Perkel <marc@???> and compare the "Marc Perkel" part to
>> the list.
>>
>> if ${something that returns Marc Perkel} matches
>> "${readfile{/etc/exim/blockbyname}{|}}"
>>
>> What code would replace ${something that returns Marc Perkel} ?
>
>
> I haven't tested it or checked thoroughly the syntax, but I think
> that the expression I gave (I replaced " " with "\s" although I think
> they are equivalent):
>
> ${if match{$h_from}{^From:\s*(.*)\s*<}{$1}{}}
>
> applied on a $h_from of the form "From: xxx yyy <..." will return "xxx
> yyy".
> Of course if $h_from does not start with ^From it will return the
> empty string (that is the content of the last set of braces {}).
> If $h_from is of the form " xxx yyy <..", with optional whitespace at
> the beginning and before the <, then your match would be:
>
> ${if match{$h_from}{^\s*(.*)\s*<}{$1}{}}
>
>
> You can test my expression using pcretest and giving the following RE
>
> ^(\s*)(.*)(\s*<)
>
> this will return, as match 2, what my expression above returns.
>
> So you would use one of the above expressions in place of ${something
> that returns Marc Perkel}. You could use it as a lookup argument, for
> instance.
>
> Giuliano
> --
> H U M P H
>    || |||
>  software

>
> Java & C++ Server/Client/Human Interface applications on MacOS - MacOS X
> http://www.humph.com/
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> Exim details at http://www.exim.org/ ##
>
>