diff --git a/src/pkg/net/mail/message.go b/src/pkg/net/mail/message.go index 96c796e7804e77fc13697b7b333edba635cc9038..7cec302965723ba49aef43414c6179936b94872e 100644 --- a/src/pkg/net/mail/message.go +++ b/src/pkg/net/mail/message.go @@ -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. diff --git a/src/pkg/net/mail/message_test.go b/src/pkg/net/mail/message_test.go index 2e746f4a722c8422b12b7ff8257bfeb676866430..3c037f38385209ec3b23555d7d5c0a9475359370 100644 --- a/src/pkg/net/mail/message_test.go +++ b/src/pkg/net/mail/message_test.go @@ -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 {