Skip to content

[3.8] bpo-37482: Fix email address name with encoded words and specia… #15380

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 29, 2019
Merged

[3.8] bpo-37482: Fix email address name with encoded words and specia… #15380

merged 1 commit into from
Aug 29, 2019

Conversation

bsiem
Copy link
Contributor

@bsiem bsiem commented Aug 22, 2019

…l chars (GH-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]

https://bugs.python.org/issue37482

…l chars (GH-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]>
@ned-deily
Copy link
Member

It looks like this backport had to be restarted and did not get merged like the 3.7 backport did. With the 3.8.0b4 cutoff approaching, I'm going to manually push merge it for 3.8.

@ned-deily ned-deily merged commit bd127b1 into python:3.8 Aug 29, 2019
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