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

GH-78319: Stop sending the UTF8 marker when appending messages#107290

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

Open
arnt wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromarnt:imap4rev2-utf8accept-append

Conversation

@arnt
Copy link

@arntarnt commentedJul 26, 2023
edited by bedevere-bot
Loading

The UTF8 marker is defined in RFC 6855 and tells the server that the message being appended contains UTF8 addresses, an unencoded UTF8 subject, etc. However, if a client appends a message containing UTF8 addresses but without that marker, the bytes can only be parsed as UTF8 because that's the only RFC-compliant way to parse those bytes.

RFC 6855 says clients MUST send the UTF8 marker.

Due to an accidental discrepancy, RFC 9051 (IMAP4rev2) does not contain that marker. IMAP4rev2 was intended to be upwardly compatible with RFC 6855, but this problem broke that. This has no ill effects, since the marker does not change the message's meaning.

While investigating the problem, I noticed that Python uses the marker incorrectly: Python uses it to mark ALL messages if UTF8=ACCEPT support has been enabled, not just ones that contain UTF8 addresses.

The best way forward appear to be using the syntax defined in RFC 9051 and publishing a revision to RFC 6855, so this change modifies imaplib to match RFC 9051.

FWIW JMAP is like IMAP4rev2 in this case; UTF8 is just there, without any marker. Also, neither UTF8=ACCEPT, IMAP4rev2 or JMAP provide any way to learn whether a message was stored with or without the marker.

This quasi-accidentally solves#78319 by removing the case that broke.

…to a mailbox.The UTF8 marker is defined in RFC 6855 and tells the server that themessage being appended contains UTF8 addresses, an unencoded UTF8 subject,etc.  However, if a client appends a message containing UTF8 addresses butwithout that marker, the bytes can only be parsed as UTF8 because that'sthe only RFC-compliant way to parse those bytes.RFC 6855 says clients MUST send the UTF8 marker.Due to an accidental discrepancy, RFC 9051 (IMAP4rev2) does not containthat marker. IMAP4rev2 was intended to be upwardly compatible with RFC6855, but this problem broke that. This has no ill effects, since themarker does not change the message's meaning.While investigating the problem, I noticed that Python uses the markerincorrectly: Python uses it to mark ALL messages if UTF8=ACCEPT supporthas been enabled, not just ones that contain UTF8 addresses.The best way forward appear to be using the syntax defined in RFC 9051 andpublishing a revision to RFC 6855, so this change modifies imaplib tomatch RFC 9051.FWIW JMAP is like IMAP4rev2 in this case; UTF8 is just there, without anymarker. Also, neither UTF8=ACCEPT, IMAP4rev2 or JMAP provide any way tolearn whether a message was stored with or without the marker.This quasi-accidentally solvespython#78319 by removing the case that broke.
@arntarnt requested a review froma team as acode ownerJuly 26, 2023 11:25
@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@arnt
Copy link
Author

This seems small enough to not require a NEWS entry, I'd say.

@arnt
Copy link
Author

I submittedthe internet-draft to supersede RFC 6855 now and expect to get it to RFC fairly quickly.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@arnt@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp