[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [msmtp-users] double-quotes in local part



On Wed, 9 May 2012 01:37:50 +0200 (Central Europe Daylight Time),
Pecsenyanszky Istvan wrote:
> On Tue, 8 May 2012, Martin Lambers wrote:
> 
> >> To: "localpart."@domain
> >
> > Is that really valid? Can you point to to some standard that allows 
> > this?
> 
> It looks odd, but I think RFC5322 (and RFC2822) allows this.
> Moreover, if I understand correctly, it not just allows, but
> specifies that it has to be double-quoted (because it ends with a
> dot).
> 
> Chapter 3.4 says that an address can be an addr-spec:
> 
>    address = mailbox / group
>    mailbox = name-addr / addr-spec
> 
> Chapter 3.4.1 defines addr-spec as:
> 
>    addr-spec = local-part "@" domain
>    local-part = dot-atom / quoted-string / obs-local-part
>    dot-atom = [CFWS] dot-atom-text [CFWS]
>    dot-atom-text = 1*atext *("." 1*atext)
>    quoted-string = [CFWS]
>                    DQUOTE *([FWS] qcontent) [FWS] DQUOTE
>                    [CFWS]
> 
> In our case local-part is not a dot-atom, but a quoted-string.
> 
> RFC5321 (and RFC2821) says similarly:
> 
>    Mailbox = Local-part "@" ( Domain / address-literal )
>    Local-part = Dot-string / Quoted-string
>    Dot-string = Atom *("." Atom)
>    Quoted-string  = DQUOTE *QcontentSMTP DQUOTE
> 
> Istvan

You're right, strangely quoted local parts are indeed allowed, and
msmtp's -t implementation is not correct.

I currently don't have the time to fix this myself, but of course I will
apply a patch if someone fixes the function msmtp_read_addresses() in
src/msmtp.c.

I don't think it is a very critical issue since RFC 3696 says "These
quoted forms are rarely recommended, and are uncommon in practice" (and
in fact you are the first to notice this in more than 7 years).

Regards,
Martin