Message362687
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 <joe@xn--exampl-gva.com>"
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. |
|
Date |
User |
Action |
Args |
2020-02-26 09:36:15 | drlazor8 | set | recipients:
+ drlazor8, barry, r.david.murray |
2020-02-26 09:36:15 | drlazor8 | set | messageid: <1582709775.3.0.571538664603.issue39757@roundup.psfhosted.org> |
2020-02-26 09:36:15 | drlazor8 | link | issue39757 messages |
2020-02-26 09:36:15 | drlazor8 | create | |
|