Re: [Exim] regexp, match, start of string (^) weirdness

Pàgina inicial
Delete this message
Reply to this message
Autor: Christian Balzer
Data:  
A: exim-users
Assumpte: Re: [Exim] regexp, match, start of string (^) weirdness
Nico Erfurth wrote:
>Christian Balzer wrote:
>> Hello,
>>
>> I'm stumped, confused and utterly sure there is a very simple explanation
>> for this which will make me look quite silly, but that's OK as long as
>> I stop wasting time figuring it out. ;)
>>
>> I'm trying to move the bogus/spam sign helo traps from the central
>> filter to the new acl_smtp_helo, based on the example by William Thompson
>> from the start of this month.
>>
>> 2 sample lines from the ACL, I copied William's one match verbatim to
>> make sure I'm not seeing pink elephants:
>> ---
>> {match{lc:$sender_helo_name}{\N^gol.com$\N}}\
>         ^^^^^^^^^^^^^^^^^^^^^^^
>         Check your syntax.
>> {match{lc:$sender_helo_name}{\N^\[?\d+\.\d+\.\d+\.\d+\]?$\N}}\
>         ^^^^^^^^^^^^^^^^^^^^^^
>          same here

>
>>
>> If I feed a helo of "gol.com" or "[33.33.33.33]" (w/o the double quotes of
>> course) to that ACL respectively, it does NOT match. However if I remove
>> the "^" it does, but of course matches more than I want it to.
>> So where is my error here, it shouldn't need any further escaping asides
>> from \N, does $sender_helo_name have some extra characters at the start?
>> It obviously has nothing extraneous at the end.
>
>because what you currently do is
>{match{lc:gol.com}{\N^gol.com$\N}}
>        ^^^^^^^^^^^This is just a simple string

>
>what you really want is
>{match{${lc:$sender_helo_name}}{\N^gol.com$\N}}
>        ^^                    ^
>        See the difference :)

>

That did the trick, thanks. It not being an actual syntax error did quite
well to mask the real reason. ^^

"You are in a maze of twisty little braces, all alike."

Dewa,

Christian
--
Christian Balzer        Network Engineer        Engineering
chibi@???       Global OnLine Japan/Fusion Network Services
http://www.gol.com/