]> Cypherpunks repositories - gostls13.git/commit
net/mail: better error in ParseAddress when missing "@domain"
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 5 Mar 2019 22:31:37 +0000 (22:31 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 6 Mar 2019 07:56:20 +0000 (07:56 +0000)
commit178a2c42254166cffed1b25fb1d3c7a5727cada6
treefadd51a5c1fbeedaa082034a0ff191b54143ab20
parent583fddf3bc85802869ce2d286fe8b32cc6728bc8
net/mail: better error in ParseAddress when missing "@domain"

If the input was "John Doe", we're definitely missing "<email>", as
"John Doe@domain" isn't a valid email address.

However, if the input was "john.doe", it's possible that the user meant
"john.doe@domain", and not just "john.doe <email>". Make it clear in the
error that either could be the source of the problem.

Fixes #27064.

Change-Id: I1b8f1342775d711823dffc3db974898ee62d3a34
Reviewed-on: https://go-review.googlesource.com/c/go/+/165517
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/mail/message.go
src/net/mail/message_test.go