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 Merge with 3.5 2016-09-09 12:09:07 -07:00
__main__.py Issue #22002: Make full use of test discovery in test sub-packages. 2014-07-23 12:00:29 -05:00
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 Merge with 3.5 2016-05-06 17:35:21 -04:00
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 bpo-27397: Make email module properly handle invalid-length base64 strings (#7583) 2018-06-12 15:46:22 +03:00
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 #28047: Fix calculation of base64 line length. 2016-09-09 15:00:09 -04:00
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 #20476: add a message_factory policy attribute to email. 2016-09-09 18:39:18 -04:00
test_pickleable.py Issue #22777: Test pickling with all protocols. 2014-12-15 14:03:42 +02:00
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 Issue 26912: fix broken imports in test_email package. 2016-05-06 17:35:05 -04:00