Skip to content

[3.7] bpo-37482: Fix email address name with encoded words and special chars (GH-14561) #15371

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2019

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Aug 21, 2019

Special characters in email address header display names are normally
put within double quotes. However, encoded words (=?charset?x?...?=) are
not allowed withing double quotes. When the header contains a word with
special characters and another word that must be encoded, the first one
must also be encoded.

In the next example, the display name in the From header is quoted and
therefore the comma is allowed; in the To header, the comma is not
within quotes and not encoded, which is not allowed and therefore
rejected by some mail servers.

From: "Foo Bar, France" [email protected]
To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= [email protected]

https://bugs.python.org/issue37482
(cherry picked from commit df0c21f)

Co-authored-by: bsiem [email protected]

https://bugs.python.org/issue37482

pythonGH-14561)

Special characters in email address header display names are normally
put within double quotes. However, encoded words (=?charset?x?...?=) are
not allowed withing double quotes. When the header contains a word with
special characters and another word that must be encoded, the first one
must also be encoded.

In the next example, the display name in the From header is quoted and
therefore the comma is allowed; in the To header, the comma is not
within quotes and not encoded, which is not allowed and therefore
rejected by some mail servers.

From: "Foo Bar, France" <[email protected]>
To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= <[email protected]>

https://bugs.python.org/issue37482
(cherry picked from commit df0c21f)

Co-authored-by: bsiem <[email protected]>
Copy link
Contributor

@maxking maxking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@miss-islington
Copy link
Contributor Author

@bsiem: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit c5bba85 into python:3.7 Aug 21, 2019
@miss-islington miss-islington deleted the backport-df0c21f-3.7 branch August 21, 2019 23:21
@miss-islington
Copy link
Contributor Author

@bsiem: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants