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

proposal: net/mail: special error for empty group address #28638

Closed
neganovalexey opened this issue Nov 7, 2018 · 2 comments
Closed

proposal: net/mail: special error for empty group address #28638

neganovalexey opened this issue Nov 7, 2018 · 2 comments
Labels
FrozenDueToAge Proposal WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@neganovalexey
Copy link
Contributor

Empty group address is often used to hide email recipients, for example,

To: undisclosed-recipient:;

(http://www.postfix.org/postconf.5.html#undisclosed_recipients_header)

The mail.ParseAddress() function returns nil and error on such inputs now, and this error ("mail: empty group") is not exported. Hence it is difficult to parse a wide range of emails.
I suggest to declare an exported error variable that could be used to detect the case. It will not change behavior of any existing Go program, but it will significantly help for email parsing.

@gopherbot gopherbot added this to the Proposal milestone Nov 7, 2018
@rsc
Copy link
Contributor

rsc commented Nov 28, 2018

If you parse

To: undisclosed-recipient:;
To: Joe <joe@joe.com>
To: Joe <joe@joe.com>, Jane <jane@jane.com>

with ParseAddress, then only the second case will succeed. ParseAddress means 1 address. So don't you want ParseAddressList anyway, which accepts both 0 and 2 addresses? And then you shouldn't need this error to be exported.

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 29, 2018
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Proposal WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants