New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/mail: ParseAddress ignore comment in parentheses after email address #21257
Comments
RFC 5322 also mentions under section 3.2.2 that "comments may nest," and that "there are several places in this specification where comments and FWS may be freely inserted." Implementing this feature would probably require implementing folding white space (FWS). Please specify
|
I am not sure that i understand correclty but all spaces already ignored https://github.com/golang/go/blob/master/src/net/mail/message.go#L272 . |
Whitespace is currently not folded (consuming runs of carriage returns and newlines), but I suppose single-line comments are enough.
Nowhere does the parser say that ParseAddress is fully RFC 5322 compliant. In fact it explictly documents otherwise, notably L287: Groups, L221: FWS, and L376: domain-literal.
Assuming that the level of nesting is bounded, and that comments are allowed before and after the address, this sounds like a reasonable request. Though in practice, I don't think more than one level is necessary. |
Change https://golang.org/cl/53550 mentions this issue: |
Hi. |
You sent the CL during the freeze, sorry. We will eventually sweep it up, but pinging, as you just did, is a good idea too. Sorry for the delay. |
What version of Go are you using (
go version
)?go version go1.8.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/3OTryRCHf8
What did you expect to see?
mark@cbosgd.ATT.COM
as parsed emailWhat did you see instead?
error with
mail: expected single address, got "(Mark Horton)"
at rfc 5322
mailbox = name-addr / addr-spec
name-addr = [display-name] angle-addr
angle-addr = [CFWS] "<" addr-spec ">" [CFWS] /obs-angle-addr
CFWS = (1*([FWS] comment) [FWS]) / FWS)
so
CFWS
can contian comment in parentheses and i think that it must be ingoredThe text was updated successfully, but these errors were encountered: