Re: [exim] ACL filtering

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Ian Eiloart
Fecha:  
A: Always Learning, Exim Users
Cc: John Jetmore
Asunto: Re: [exim] ACL filtering


--On 24 April 2010 01:11:00 +0100 Always Learning
<exim.users@???> wrote:

>
> John Jetmore wrote on Fri, 23 Apr 2010 13:39:29 -0400.
>
>
>> $ exim -be '${if
>> match{olga.hinterlands.org}{\N^.*[a].?[d].?[s].?[l]*\N}{your config is
>> broken}{}}'
>
>
>> You've misunderstood your regexp. Here's a quick explanation:
>>
>> [a] matches any character in the set of (a).
>> . matches exactly one of any character (+/- some fiddly stuff with line
>> endings) ? is a modifier which means "zero or one of the previous item"
>> * is a modifier which means "zero or more of the previous item"
>>
>> the match is on "ands":
>> "a" matches [a]
>> "n" matches .?
>> "d" matches [d]
>> "" matches .?
>> "s" matches [s]
>> "" matches [l]*
>
> Thank you for clearly explaining my misunderstanding.
>
> Your helpful explanation is very useful. Now I know why the gaps between
> the criteria letters (adsl) was not being processed in the way I had
> expected. I have changed my test to:
>
> deny    message       = [C06.5]  Msg6 Msg2
>         hosts         =
> ^.*[a](1)[-_.](.?)[d](1)[-_.](.?)[s](1)[-_.](.?)[l](1).*


Just write .*adsl.*

You don't need the square brackets when the set has only one member. You
don't need to quantify when you're only looking for one occurrence. Perl
has no 'a'.

>
>
> ^ = beginning of string
>
> .* = any quantity, or none, of any characters
>
> [a](1) = match only one 'a'
>
> [-_.](?) = match next character which should be one or nil occurrences
> of .-_
>
> [d](1) = match only one 'd'
>
> [-_.](?) = match next character which should be one or nil .-_
>
> [s](1) = match only one 's'
>
> [-_.](?) = match next character which should be one or nil .-_
>
> [l](1) = match only one 'l'
>
> [-_.](?) = match next character which should be one or nil .-_
>
> .* = any quantity, or none, of any characters
>
>
> You are obviously a good technical programmer.
>
> Thank you again.
>
> Paul.
>
> --




--
Ian Eiloart
IT Services, University of Sussex
01273-873148 x3148
For new support requests, see http://www.sussex.ac.uk/its/help/