Skip to content

gh-49555: Support international mailbox names in imaplib#153391

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:imaplib-mutf7-mailbox
Open

gh-49555: Support international mailbox names in imaplib#153391
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:imaplib-mutf7-mailbox

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 9, 2026

Copy link
Copy Markdown
Member

Mailbox names are now encoded as modified UTF-7 (RFC 3501, section 5.1.3), so an international mailbox name can be passed to any command as an ordinary str.

For backward compatibility, a str that is already valid modified UTF-7 — for example a name obtained from a raw LIST response and decoded as ASCII — is sent unchanged, and a bytes argument is sent verbatim (bypassing encoding), so existing code keeps working. Under UTF8=ACCEPT, mailbox names are sent as UTF-8 instead.

This builds on the utf-7-imap codec added in gh-66788.

Non-ASCII mailbox names are now encoded as modified UTF-7 (RFC 3501,
section 5.1.3), so they can be passed as an ordinary str.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33508763 | 📁 Comparing f6d7a81 against main (d6855c8)

  🔍 Preview build  

3 files changed
± library/imaplib.html
± whatsnew/3.16.html
± whatsnew/changelog.html

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant