Re: [exim] ${address: foo(comment)@bar.org}

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Jeremy Harris
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] ${address: foo(comment)@bar.org}
On 13/02/2019 11:07, Mike Brudenell via Exim-users wrote:
> Hmm… There does seem to be an oddity.


Agreed.

> Jasen gave a link to an "extreme
> example" included in the RFC:
>
> https://tools.ietf.org/html/rfc5322#appendix-A.5
>
>
> Trying this in various forms using Exim 4.90.1 on Ubuntu shows up some
> interesting things:
>
> exim -v -be '${address:Pete(A nice chap) <pete@???>}'
>
> gives pete@???
>
> exim -v -be '${address:Pete(A nice \) chap) <pete@???>}'
> gives the empty string, suggesting Exim thinks it's a parse error


You'd be needing to double the backslash, for the string-parsing
stage of the 822 address there, to actually get a backslash as
part of the 822 address. Do that, and it's fine and gets
the right result for the expansion.

>
> exim -v -be '${address:Pete(A nice chap) <pete(his account)@silly.test(his
> host)>}'
>
> gives pete(his account)@silly.test(his host)


That's our bug. We're not dropping the 822-comment in either the
local-part or domain of the extracted address.

> From the RFC's description I think it's expecting all to yield
> pete@???


Yup.

> The same "extreme example" has some even more fiendish addresses in the
> samples To and Cc headers which I've not tried.


I did; they seem to be ok.

> Incidentally, the first couple of times I tried the above I forget to wrap
> the address within ${address: … } and the result was Exim generating a
> PANIC:


(note, an entry in the panic-log. Not a process panic like a SEGV.)

> exim -v -be 'Pete(A nice chap) <pete(his account)@silly.test(his host)>'
> gives
>
> LOG: PANIC
> Exim configuration error in line 1590 of /etc/exim4/exim4.conf:
> malformed macro definition


The string starts with a capital, so Exim thinks it's a macro
(they recently became supported by "-be").
We might do better with the error location given, but calling
it an error is correct.
--
Cheers,
Jeremy