]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.22] net/mail: properly handle special characters in phrase and...
authorRoland Shoemaker <bracewell@google.com>
Wed, 10 Jan 2024 19:02:14 +0000 (11:02 -0800)
committerCarlos Amedee <carlos@golang.org>
Wed, 28 Feb 2024 19:10:13 +0000 (19:10 +0000)
commit5330cd225ba54c7dc78c1b46dcdf61a4671a632c
tree4ae33ce82c9ad9712e8a210247a890e61c1efb1f
parentd8c4239f089b568d4246409a2ec2018a6cf6b6bc
[release-branch.go1.22] 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.

For #65083
Fixed #65849

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>
Reviewed-on: https://go-review.googlesource.com/c/go/+/566215
Reviewed-by: Carlos Amedee <carlos@golang.org>
src/net/mail/message.go
src/net/mail/message_test.go