Re: [exim] Regexp match on a header

Página Inicial
Delete this message
Reply to this message
Autor: Ian Zimmerman
Data:  
Para: exim-users
Assunto: Re: [exim] Regexp match on a header
On 2016-12-26 21:19, Chris Siebenmann wrote:

> > temporarily rejected after DATA: failed to expand ACL string \
> > "${if match {$bh_received:}{\N[[](\d+[.]\d+[.]\d+[.]\d+)[]]} $1 {}}": missing
> > } at end of string
> >
> > The braces are balanced, so why is a closing one "missing"?
>
> The braces are matched but the \N at the start of the regular expression
> is not. The missing ending \N means that everything (including the
> closing braces) is taken as part of the regular expression, so you
> effectively have:
>
>     "${if match {$bh_received:}{\N<opaque regex>"

>
> and the string just ends on the parser without it seeing the necessary
> closing }'s.


Thanks. I added the closing \N but the error just got more confusing:

  warn
        set acl_m_data_rip = ${if match {$bh_received:}{\N[[](\d+[.]\d+[.]\d+[.]\d+)[]]\N} $1 {}}


  warn
        condition = $acl_m_data_rip
        logwrite = IP address from Received header is $acl_m_data_rip


temporarily rejected after DATA: failed to expand ACL string \
"${if match {$bh_received:}{\N[[](\d+[.]\d+[.]\d+[.]\d+)[]]\N} $1 {}}": \
missing or misplaced { or }

PS. - I may remember you from my time in Toronto but I'm not sure. Did
you go to the Unanimous meetings? I do remember there was at least one
strong exim advocate there :-)

--
Please *no* private Cc: on mailing lists and newsgroups
Personal signed mail: please _encrypt_ and sign
Don't clear-text sign: http://cr.yp.to/smtp/8bitmime.html