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: Parsing address "foo@bar.com <foo@bar.com>" fails #39258

Closed
ThomasHabets opened this issue May 26, 2020 · 2 comments
Closed

net/mail: Parsing address "foo@bar.com <foo@bar.com>" fails #39258

ThomasHabets opened this issue May 26, 2020 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@ThomasHabets
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version go1.14 linux/amd64

Does this issue reproduce with the latest release?

Yes. And play.golang.org

What operating system and processor architecture are you using (go env)?

Debian Linux amd64

What did you do?

Try to parse an address using net/mail.

https://play.golang.org/p/PzvfiO0LVT7

package main

import (
	"fmt"
	"net/mail"
)

func main() {
	_, err := mail.ParseAddressList("foo@bar.com <foo@bar.com>")
	if err != nil {
		fmt.Println("Error: ", err)
	}
}

What did you expect to see?

For it to be accepted. I don't know if it's standards compliant, but it's unambiguous to me.

What did you see instead?

Parsing the address failed with an error. "Expected comma".

@ianlancetaylor
Copy link
Contributor

I believe this is correct according to RFC 5322. The @ character is not permitted in a comment, so foo@bar.com must be an e-mail address. There is then a comma missing before the next e-mail address, which is <foo@bar.com>.

@ianlancetaylor ianlancetaylor added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 26, 2020
@ThomasHabets
Copy link
Contributor Author

Reading that more carefully, yes I think you're right. It works quoted, which also seems correct.

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

No branches or pull requests

3 participants