SIGN IN SIGN UP

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

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 5aaf4168583)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
R
R. David Murray committed
a4ef689ce670684ec132204b1cd03720c8e0a03d
Parent: cfaee20
Committed by GitHub <noreply@github.com> on 4/3/2025, 4:58:22 PM