ietf-822
[Top] [All Lists]

Re: quoted strings within quoted strings

2002-03-01 16:10:58


In <200202281732(_dot_)g1SHWaF22699(_at_)astro(_dot_)cs(_dot_)utk(_dot_)edu> 
Keith Moore <moore(_at_)cs(_dot_)utk(_dot_)edu> writes:


So what is the proper way to do it?
Would it be

       sender = "\"John D. Bloggs\" <jdbloggs(_at_)example(_dot_)com>"

IMHO yes.  and the value encded by that sender parameter is

"John D. Bloggs" <jdbloggs(_at_)example(_dot_)com>

OK. So is that behaviour written down anywhere (in RFC 2822 or RFC 2045)?

It is explicitly and formally laid out in the general parameter ABNF. Formal
languages are really good at this sort of thing.

Or is it already implicit in those documents.

The use of the syntax to represent this sort of value is implicit, but IMO
completely obvious. This is also the approach used in RFC822, RFC2822, and
countless other documents.

Or, to put it another way,
does the first person who invents a parameter like that (which look like
it will be me) have to say anything special to cover that case?

No.

Well, I
shall of course draw attention to it in a NOTE, but need I do more than
that?

Not even a note is required.

Answer: I think I do. There is special wording of that nature in RFC 2122
(Multipart/Related) when describing the syntax of related-param.

Just because one specification went out of its way to belabor the obvious
is no reason you have to do so in yours.

So I think I have to write something like

sender-parameter = [CFWS] "sender" [CFWS] "=" [CFWS]
                      <a quoted-string containing an escaped mailbox> [CFWS]

where I have to define "escaped" in the proper (recursive) way, and
probably also an "unescaping" operation.

The MIME specification used to have per-parameter ABNF like this. The problem
is that this ABNF is inevitably at odds with the more general ABNF and ends up
being hugely confusing.

And there is ample data to support this point. I received numerous queries and
complaints about the overlapping ABNF in the original MIME specification. Your
query is the first I've seen about this sort of thing since all this gratuitous
junk was removed from the MIME documents.

Does that sound right?

No.

                                Ned