New submission from B Siemerink <b.siemer...@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" <f...@example.com>
To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= <f...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue37482>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to