[issue37482] Email header fails with both encoded words and special chars

B Siemerink report at bugs.python.org
Tue Jul 2 07:51:15 EDT 2019


New submission from B Siemerink <b.siemerink at redforts.com>:

Special characters in email headers 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 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 rejected.

From: "Foo Bar, France" <foo at example.com>
To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= <foo at example.com>

----------
components: email
files: email_header_test.py
messages: 347136
nosy: barry, bsiem, r.david.murray
priority: normal
severity: normal
status: open
title: Email header fails with both encoded words and special chars
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48452/email_header_test.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37482>
_______________________________________


More information about the Python-bugs-list mailing list