New submission from Julien Castiaux <[email protected]>:
Affected python version: 3.5 and above (did test them all except 3.9)
Steps to reproduce:
from mail.message import EmailMessage
from mail.policy import SMTP
msg = EmailMessage(policy=SMTP)
msg['To'] = 'Joe <joe@examplé.com>' # notice the é in the domain
print(msg.as_string())
It prints
To: "Joe <joe@=?utf-8?q?exampl=C3=A9?=.com>"
But it should be
To: "Joe <[email protected]>"
While b64/qp can be used to encode most non-ascii headers, the domain part of
an email address is an exception. According to IDNA2008 (rfc5890 , rfc5891),
non-ascii domain should be encoded using the punycode algorithm and the ACE
prefix.
----------
components: email
messages: 362687
nosy: Julien Castiaux, barry, r.david.murray
priority: normal
severity: normal
status: open
title: EmailMessage wrong encoding for international domain
type: behavior
versions: Python 3.5
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39757>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com