Subject: [EAI] mailbox in rfc5321 and 5322 VS mailbox in rfc5335bis and 5336bis

From: "Jiankang YAO" <[email-masked]>
Date: Sat, 27 Nov 2010 23:14:30 +0800

Dear all,

the mailboxs definitions in RFC5321 and 5322 are defined for different purposes.

the mailboxs definitions in RFC5321 are for commands and envelope, so can not include CFWS;
the mailboxs definitions in RFC5322 are for mail headers, so can include CFWS.

similarly, it seems that mailbox definitions in rfc5335bis and 5336bis have to be defined differently in both documents.

Jiankang Yao

----------------------------------------------------------------------------
Below are some syntax definitions copied from rfc5321 and rfc5322
-----------------------------------------------------------------------------
in rfc 5321

Mailbox        = Local-part "@" ( Domain / address-literal )
 address-literal  = "[" ( IPv4-address-literal /
                    IPv6-address-literal /
                    General-address-literal ) "]"

   Domain         = sub-domain *("." sub-domain)

   sub-domain     = Let-dig [Ldh-str]

   Local-part     = Dot-string / Quoted-string                  ; MAY be case-sensitive   Dot-string     = Atom *("."  Atom)   Atom           = 1*atextin rfc 5322mailbox         =   name-addr / addr-spec

   name-addr       =   [display-name] angle-addr

   angle-addr      =   [CFWS] "<" addr-spec ">" [CFWS] /
                       obs-angle-addr
addr-spec       =   local-part "@" domain

   local-part      =   dot-atom / quoted-string / obs-local-part

   domain          =   dot-atom / domain-literal / obs-domain

   domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]

  atom            =   [CFWS] 1*atext [CFWS]

-----------------------------------------------------------------------------

---

From: John C Klensin <[email-masked]>
Date: Sat, 27 Nov 2010 16:05:31 -0500

--On Saturday, November 27, 2010 11:14 PM +0800 Jiankang YAO
<[email-masked]> wrote:

> the mailboxs definitions in RFC5321 are for commands and
> envelope, so can not include CFWS; the mailboxs definitions in
> RFC5322 are for mail headers, so can include CFWS.

Unless I'm misunderstanding, the key issue is not the CFWS or
the envelope; it is two related issues:

(1) The way the definitions in 5322 are arranged is not optimal
for this purpose (or for those of 5321 compatibility).   
The <mailbox> of Section 3.4 could rationally be rewritten as 

   mailbox = name-addr | SMTP-addr | addr-spec
   SMTP-addr = "<" addr-spec ">"
   
i.e., either a name-addr (with the optional display-name and
optional brackets, CWFS, etc.) or a narrowly-defined SMTP
address (brackets required) or an addr-spec without the brackets.

If it had been done that way, or something like it, then 5321
could use a definition identical to that of 5322 (Pete, consider
this a not-subtle hint about 5322bis/5321bis should we start
YAMmering again).    One could simplify this even further -- see
(2) below.

>From that point of view, 5336 needs to pick up on the 5335
equivalent of "addr-spec" and not on "mailbox" or "address".

(2) From a slightly different point of view, what has created
the confusion here is that 5321 (correctly, IMO) uses the term
"mailbox" to refer to what 5322 calls an addr-spec (no brackets
or spacing), while 5322 uses "mailbox" to refer to something
that might potentially contain a display-name, CWFS in various
interesting places (including inside the display-name), some
brackets (required if the display name is present), and possibly
a comment (whether the comment is logically part of the
5322-mailbox is part of the reason we circled from group syntax
to comment syntax and back in the discussions in Beijing ...
certainly there is extensive historical/ operational deployment
precedent for treating it as both part and not-part).

As a mental exercise as to what the "mailbox" actually is,
consider whether there are any deployed systems that would treat 

     Joe <[email-masked]>
     John <[email-masked]>

as going to different destinations in a mail store.  I can
remember systems that would dispatch differently (think 

     Joe Smith <[email-masked]> )
but we got over those, usually in favor of such arrangements as
     Joe Smith
<[email-masked]>,  a
_very_ long time ago.

> similarly, it seems that mailbox definitions in rfc5335bis and
> 5336bis have to be defined differently in both documents.

Well, see if 5336 and 5336 can make a common "addr-spec" (or
5321-mailbox) definition work without worrying about
5322-mailbox.

   john

---

From: "Jiankang YAO" <[email-masked]>
Date: Sun, 28 Nov 2010 22:14:15 +0800

----- Original Message ----- 
From: "John C Klensin" <[email-masked]>
To: "Jiankang YAO" <[email-masked]>; <[email-masked]>
Sent: Sunday, November 28, 2010 5:05 AM
Subject: Re: [EAI] mailbox in rfc5321 and 5322 VS mailbox in rfc5335bis and 5336bis

....
> 5321-mailbox) definition work without worrying about

any other comments?

it may be much clearer if  the mailbox definition in rfc5335 and rfc5336 still apply that in rfc5335bis and rfc5336bis.

Jiankang Yao