net/mail: ParseAddress() accepts valid RFC 5322 addresses with domain part starting with a dash which are invalid RFC 1035 addresses, should we tighten the permissive validation? #39488
Labels
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes: https://play.golang.org/p/Z3a5zj6Qch6
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/Z3a5zj6Qch6
What did you expect to see?
I'm expecting the test to pass, since
test@--domain.com
is not a valid address.A domain can't starts or ends with a dash according to this RFC
What did you see instead?
The email address is properly parsed with the invalid domain.
The text was updated successfully, but these errors were encountered: