close
Skip to content

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

Merged
ned-deily merged 1 commit intopython:3.8from
bsiem:backport-df0c21f-3.8
Aug 29, 2019
Merged

[3.8] bpo-37482: Fix email address name with encoded words and specia…#15380
ned-deily merged 1 commit intopython:3.8from
bsiem:backport-df0c21f-3.8

Conversation

@bsiem
Copy link
Copy Markdown
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" foo@example.com
To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= foo@example.com

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

Co-authored-by: bsiem 52461103+bsiem@users.noreply.github.com

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" <foo@example.com>
To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= <foo@example.com>

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

Co-authored-by: bsiem <52461103+bsiem@users.noreply.github.com>
@ned-deily
Copy link
Copy Markdown
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