Skip to content
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: correctly handle whitespaces when formatting an email address #6641

Closed
hongrich opened this issue Oct 22, 2013 · 6 comments
Closed

net/mail: correctly handle whitespaces when formatting an email address #6641

hongrich opened this issue Oct 22, 2013 · 6 comments
Milestone

Comments

@hongrich
Copy link

@hongrich hongrich commented Oct 22, 2013

net/mail: correctly handle whitespaces when formatting an email address

Whitespace characters are allowed in quoted-string according to RFC 5322 without
being "Q"-encoding. Address.String() already always formats the name portion in
quoted string, so whitespace characters should be allowed in there.

Currently, http://play.golang.org/p/wQGqBhvbXL produces

=?utf-8?q?First_Last?= <foo@bar.org>

but it contains no non-ASCII characters, so it should format to

"First Last" <foo@bar.org>

https://golang.org/cl/15380044/
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 25, 2013

Comment 1 by maarten@brightcode.nl:

I also wanted to report this bug. According to RFC 5322 email address should follow
these rules:
name-addr       =   [display-name] angle-addr
display-name    =   phrase
phrase          =   1*word / obs-phrase
word            =   atom / quoted-string
atom            =   [CFWS] 1*atext [CFWS]
So a phrase of (printable ascii) words separated by whitespace is also allowed.
@rsc
Copy link
Contributor

@rsc rsc commented Nov 27, 2013

Comment 2:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 4, 2013

Comment 3:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 4, 2013

Comment 4:

Labels changed: added repo-main.

@davecheney
Copy link
Contributor

@davecheney davecheney commented Feb 5, 2014

Comment 5:

https://golang.org/cl/55770043/

Labels changed: added release-go1.3, removed priority-triage, release-none.

Status changed to Started.

@dsymonds
Copy link
Member

@dsymonds dsymonds commented Feb 6, 2014

Comment 6:

This issue was closed by revision d3b9567.

Status changed to Fixed.

@hongrich hongrich added fixed labels Feb 6, 2014
@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.