Commit 73b8baa1 authored by Ryan Slade's avatar Ryan Slade Committed by Brad Fitzpatrick

net/mail: AddressList fails to parse addresses with a dot

Fixes #4938.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12657044
parent 2f0acc1e
......@@ -342,7 +342,7 @@ func (p *addrParser) consumePhrase() (phrase string, err error) {
word, err = p.consumeQuotedString()
} else {
// atom
word, err = p.consumeAtom(false)
word, err = p.consumeAtom(true)
}
// RFC 2047 encoded-word starts with =?, ends with ?=, and has two other ?s.
......
......@@ -225,6 +225,16 @@ func TestAddressParsing(t *testing.T) {
},
},
},
// Custom example with "." in name. For issue 4938
{
`Asem H. <noreply@example.com>`,
[]*Address{
{
Name: `Asem H.`,
Address: "noreply@example.com",
},
},
},
}
for _, test := range tests {
if len(test.exp) == 1 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment