SIGN IN SIGN UP

[3.12] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (#129008)

gh-80222: Fix email address header folding with long quoted-string (GH-122753)

Email generators using email.policy.default could incorrectly omit the
quote ('"') characters from a quoted-string during header refolding,
leading to invalid address headers and enabling header spoofing. This
change restores the quote characters on a bare-quoted-string as the
header is refolded, and escapes backslash and quote chars in the string.
(cherry picked from commit 5aaf41685834901e4ed0a40f4c055b92991a0bb5)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
M
Miss Islington (bot) committed
b8170e58849a7728ebc9b58e222aa5bd051cf7c4
Parent: fceb8c3
Committed by GitHub <noreply@github.com> on 1/19/2025, 9:07:39 PM