Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#33968 closed New feature (wontfix)

Make EmailValidator and URLValidator IDNA 2008 compliant

Reported by: j-bernard Owned by: nobody
Component: Core (Other) Version: 4.0
Severity: Normal Keywords: IDNA EAI EmailValidator UrlValidator RFC
Cc: Florian Apolloner Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


This ticket is the second 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 ticket: #33967

Domain validation is not fully compliant with IDNA 2008 (either in EmailValidator or UrlValidator) as defined in RFC5891 section-4.2

A domain name cannot be validated properly with a regex, therefore, an IDN validation should be performed with an appropriate library.

The current validation ignores IDNA errors. Instead, IDNA should be used for domain validation and the regex validation should be skipped for domains as it may lack some specific rules and then end up with invalid domains being accepted.

Moreover, the current validation is made by performing a conversion to A-Label with the Python encodings.idna module which implements a deprecated standard (IDNA 2003).

This conversion should be made IDNA 2008 compliant. The most used Python IDNA 2008 package is idna, which is among the most downloaded Python packages according to PyPI (4th as for the current month) and referred in the official Python documentation.

Change History (2)

comment:1 Changed 3 months ago by Mariusz Felisiak

Cc: Florian Apolloner added
Component: Core (Mail)Core (Other)
Resolution: wontfix
Status: newclosed
Type: UncategorizedNew feature

Thanks for this ticket, however adding a new dependency is always controversial and it isn't a light decision so a strong consensus on the mailing list is required. Please first start a discussion on the DevelopersMailingList, where you'll reach a wider audience and see what other think, and follow the guidelines with regards to requesting features.

Personally, I don't think it's worth complexity. My initial response would be similar to the Python's, i.e. "If you need the IDNA 2008 standard from RFC 5891 and RFC 5895, use a third-party validator".

comment:2 Changed 3 months ago by j-bernard

Thanks, I started the discussion on the mailing list

Note: See TracTickets for help on using tickets.
Back to Top