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

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Mike Brudenell
日付:  
To: Exim Users
題目: Re: [exim] ${address: foo(comment)@bar.org}
On Wed, 13 Feb 2019 at 12:10, Jeremy Harris via Exim-users <
exim-users@???> wrote:

> On 13/02/2019 11:07, Mike Brudenell via Exim-users wrote:
>
> > 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.
>


Umm… That address string is taken straight out of the RFC, which states it
is a perfectly valid address for a header as it is:

https://tools.ietf.org/html/rfc5322#appendix-A.5

From: Pete(A nice \) chap) <pete(his account)@silly.test(his host)>


The above example is aesthetically displeasing, but perfectly legal.
Note particularly (1) the comments in the "From:" field (including
one that has a ")" character appearing as part of a quoted-pair);


Or would Exim, on encountering that particular From header, have not
assigned "Pete(A nice \) chap) <pete@???>" to $h_from: but instead
have itself spotted and doubled up the \ when assigning the value? I
confess I haven't tried it to check, but it seems unlikely; I'd have
expected it to copy the value verbatim?


> 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)>'
>
> 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.
>


Ah! That would explain it. I hadn't spotted that and, as I don't make much
use of macros, had forgotten about their capital letters.

Cheers,
Mike B-)

--
Systems Administrator & Change Manager
IT Services, University of York, Heslington, York YO10 5DD, UK
Tel: +44-(0)1904-323811

Web: www.york.ac.uk/it-services
Disclaimer: www.york.ac.uk/docs/disclaimer/email.htm