Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.13] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233)#122484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Yhg1s merged 2 commits intopython:3.13frommiss-islington:backport-0976339-3.13
Aug 6, 2024

Conversation

miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commentedJul 30, 2024
edited by encukou
Loading

  • Encode header parts that contain newlines

Per RFC 2047:

[...] these encoding schemes allow the
encoding of arbitrary octet values, mail readers that implement this
decoding should also ensure that display of the decoded data on the
recipient's terminal will not cause unwanted side-effects

It seems that the "quoted-word" scheme is a valid way to include
a newline character in a header value, just like we already allow
undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.

  • Verify that email headers are well-formed

This should fail for custom fold() implementations that aren't careful
about newlines.

(cherry picked from commit0976339)

Co-authored-by: Petr Viktorinencukou@gmail.com
Co-authored-by: Bas Bloemsaatbas@bloemsaat.org
Co-authored-by: Serhiy Storchakastorchaka@gmail.com


📚 Documentation preview 📚:https://cpython-previews--122484.org.readthedocs.build/

…ound (pythonGH-122233)GH-GH- Encode header parts that contain newlinesPer RFC 2047:> [...] these encoding schemes allow the> encoding of arbitrary octet values, mail readers that implement this> decoding should also ensure that display of the decoded data on the> recipient's terminal will not cause unwanted side-effectsIt seems that the "quoted-word" scheme is a valid way to includea newline character in a header value, just like we already allowundecodable bytes or control characters.They do need to be properly quoted when serialized to text, though.GH-GH- Verify that email headers are well-formedThis should fail for custom fold() implementations that aren't carefulabout newlines.(cherry picked from commit0976339)Co-authored-by: Petr Viktorin <encukou@gmail.com>Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@encukou for commita590277 🤖

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelJul 30, 2024
@encukou
Copy link
Member

The buildbot failures are unrelated/pre-existing.

As this missed rc1, I'd like toask for a review.

@ambv
Copy link
Contributor

ambv commentedAug 2, 2024

OK, then I'll wait with merging 3.11 - 3.8 until the review here is done.

@Yhg1sYhg1s merged commit4aaa425 intopython:3.13Aug 6, 2024
36 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@miss-islington@bedevere-bot@encukou@ambv@Yhg1s

[8]ページ先頭

©2009-2025 Movatter.jp