cpython/Lib/test/test_email
Brian Schubert d4df3c55e4
[3.9] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (GH-129111) (GH-132371)
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 5aaf416858)
(cherry picked from commit a4ef689ce6)

Co-authored-by: R. David Murray <rdmurray@bitdance.com>
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-06-02 17:57:06 +02:00
..
data Optimize images by IMGbot (GH-21348) 2022-02-03 23:15:17 -08:00
__init__.py
__main__.py
test__encoded_words.py bpo-43323: Fix UnicodeEncodeError in the email module (GH-32137) 2022-04-30 05:31:37 -07:00
test__header_value_parser.py [3.9] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (GH-129111) (GH-132371) 2025-06-02 17:57:06 +02:00
test_asian_codecs.py
test_contentmanager.py bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631) (GH-27687) 2021-08-10 00:34:58 +02:00
test_defect_handling.py
test_email.py [3.9] [CVE-2023-27043] gh-102988: Reject malformed addresses in email.parseaddr() (GH-111116) (#123769) 2024-09-06 13:13:54 +02:00
test_generator.py [3.9] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233) (#122610) 2024-09-04 17:39:02 +02:00
test_headerregistry.py bpo-43323: Fix UnicodeEncodeError in the email module (GH-32137) 2022-04-30 05:31:37 -07:00
test_inversion.py
test_message.py [3.9] Fix typos in the Lib directory (GH-28775) (GH-28803) 2021-10-07 08:42:38 -07:00
test_parser.py
test_pickleable.py
test_policy.py [3.9] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233) (#122610) 2024-09-04 17:39:02 +02:00
test_utils.py [3.9] gh-113027: Fix test_variable_tzname in test_email (GH-113821) (GH-126477) 2024-11-12 10:26:31 +01:00
torture_test.py