]> Cypherpunks repositories - gostls13.git/commit
net/mail: properly handle special characters in phrase and obs-phrase
authorRoland Shoemaker <bracewell@google.com>
Wed, 10 Jan 2024 19:02:14 +0000 (11:02 -0800)
committerRoland Shoemaker <roland@golang.org>
Mon, 22 Jan 2024 20:28:44 +0000 (20:28 +0000)
commite5eeadb2d8e08fa43099a52a067893d6f30bbc09
tree26060450915146d7ab6152c54de608948b71a5ef
parent5a61d8d36be864c0c87cdad9118c801b2ce17331
net/mail: properly handle special characters in phrase and obs-phrase

Fixes a couple of misalignments with RFC 5322 which introduce
significant diffs between (mostly) conformant parsers.

This change reverts the changes made in CL50911, which allowed certain
special RFC 5322 characters to appear unquoted in the "phrase" syntax.
It is unclear why this change was made in the first place, and created
a divergence from comformant parsers. In particular this resulted in
treating comments in display names incorrectly.

Additionally properly handle trailing malformed comments in the group
syntax.

Fixes #65083

Change-Id: I00dddc044c6ae3381154e43236632604c390f672
Reviewed-on: https://go-review.googlesource.com/c/go/+/555596
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/net/mail/message.go
src/net/mail/message_test.go