Changes between Initial Version and Version 2 of Ticket #36014
- Timestamp:
- Dec 15, 2024, 5:57:08 PM (3 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36014 – Description
initial v2 15 15 **Suggested fix:** EmailValidator should instead borrow its domain validation logic from DomainNameValidator, like URLValidator does (since Django 5.1). 16 16 17 **Prior discussion:** See #33968 and related [https://groups.google.com/g/django-developers/c/h80ELFgsess Django developers discussion] from 2022. Those proposed changing django.utils.encoding.punycode() to use IDNA 2008 encoding via the third party idna package. Besides adding a new dependency, it's unclear whether idna.encode() would be the correct choice in all cases. IDNA 2008 rejects some domains that IDNA 2003 allowed, so switching could introduce compatibility issues with existing data. (Also, most email services and apps seem instead to be following UTS !#46, which builds on IDNA 2008. But the selection of UTS !#46 options varies by vendor.)17 **Prior discussion:** See #33968 and related [https://groups.google.com/g/django-developers/c/h80ELFgsess Django developers discussion] from 2022. Those proposed changing django.utils.encoding.punycode() to use IDNA 2008 encoding via the third party idna package. Besides the controversy around adding a new dependency, it's unclear whether idna.encode() would be the correct choice in all cases. IDNA 2008 rejects some domains that IDNA 2003 allowed, so switching could introduce compatibility issues with existing data. (Also, most email services and apps seem instead to be following UTS !#46, which builds on IDNA 2008. But the selection of UTS !#46 options varies by vendor.) 18 18 19 19 **Compatibility:** this shouldn't break any existing code or data. But it ''would'' start allowing email addresses that Django's SMTP EmailBackend is not currently capable of mailing, like the Dhivehi example above. (django.core.mail calls punycode()—IDNA 2003—to prepare addresses for SMTP.) #35714 could address this by enabling SMTPUTF8 and offloading IDNA encoding to the SMTP server. Also, I intend the upcoming patch for #35581 to simplify subclassing the SMTP EmailBackend so users could override IDN handling with their choice of encoding options.