﻿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
33969	Improve django.core.mail.messages EAI processing	j-bernard	nobody	"This ticket is the third and last of a list of tickets aiming at bringing Email Address Internationalization (EAI) compliance to Django by supporting International Domain Name (IDN) with regards to the latest standard (IDNA 2008) and fixing some processing on internationalized domains or email addresses.
Previous tickets: #33967, #33968

`sanitize_address` transforms the email address domain in Punycode regardless of the email server's compliance with EAI.

The main issue here is that the conversion is performed with the deprecated IDNA 2003 standard instead of IDNA 2008 (see the previous ticket for more information) but this conversion should also be skipped for consistency with the user input and only performed if the server does not support Unicode email addresses.

The logic (with the backend using Python smtplib) would then be:
  - try to send the message, regardless of the presence of Unicode in the address (Python smtplib will add the right options if you use the send_message method else the SMTPUTF8 option should be provided)
  - if smtplib.SMTPNotSupportedError is raised
      - if the local-part is ASCII only, convert the domain to A-Label using and IDNA 2008 compliant library and retry
      - else return failure
 "	New feature	closed	Core (Mail)	dev	Normal	needsinfo	EAI IDNA RFC		Unreviewed	0	0	0	0	0	0
