﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35713	Django generates invalid address on unicode characters in the local part of an e-mail address	Mike Edmunds	Vaibhav Pant	"#25986 attempted to add support for non-ASCII characters in the local-part (username) of an email address, by encoding it as an RFC 2047 encoded-word. [https://github.com/django/django/pull/6377 PR#6377] landed in Django 1.10.

However, RFC 2047 [https://datatracker.ietf.org/doc/html/rfc2047#section-5:~:text=An%20%27encoded%2Dword%27%20MUST%20NOT%20appear%20in%20any%20portion%20of%20an%20%27addr%2Dspec%27. specifically prohibits] using an encoded-word in an addr-spec (the username@domain portion of an email address). Encoded-words are only allowed in address display-names.

The resulting email address is not supported by any known MTA or email client, and the message will either bounce or just disappear undelivered.

To reproduce:

{{{#!python
from django.core.mail import EmailMessage
email = EmailMessage(to=[""jörg@example.no""])
print(email.message().as_bytes().decode())  # examine generated message
# ...
# To: =?utf-8?b?asO2cmc=?=@example.no
# ...
email.send()  # if you've set up a mailbox for jörg at example.no
}}}

Actual results: as above (no errors)

Expected results: no `=?utf-8?...` encoded-word in the generated ''To'' addr-spec. And an error on the call to `send()` (or `message()`) saying that a non-ASCII local-part is not supported.

There is ''no'' supported way to send to non-ASCII usernames using 7-bit email headers. That requires using 8-bit headers with the SMTPUTF8 extension under RFC 6530/6531/6532. (That new feature request is ticket #35714; this ticket is solely about removing the current buggy behavior.)

For more details see [https://code.djangoproject.com/ticket/25986#comment:12 #25986 comments 12-13]."	Bug	assigned	Core (Mail)	dev	Normal				Accepted	0	0	0	0	0	0
