Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295035

Email Address Internationalization (EAI)

$
0
0

Problem/Motivation

Email Address Internationalization (EAI) is based on a set of RFCs published in 2012 which enables the usage of utf-8 in the local part of an email address. Additionally email addresses with Internationalized Domain Names and an ASCII only local part are not permitted.
We are currently excluding people with such email addresses, as they are not usable for registration.

Relevant RFCs are the following (taken from https://uasg.tech):
Overview and Framework for Internationalized Email
https://tools.ietf.org/html/rfc6530
SMTP Extension for Internationalized Email
https://tools.ietf.org/html/rfc6531
Internationalized Email Headers
https://tools.ietf.org/html/rfc6532
Internationalized Delivery Status and Disposition Notifications
https://tools.ietf.org/html/rfc6533

Drupal 8
The current validation of email addresses in Drupal 8 uses HTML5 based client side validation and a server side validation based on Egulias\EmailValidator.

While the server side validation is based on the above RFCs and provides good support for internationalized email addresses the client side validation fails, for it accepts only ASCII characters in the local part of email addresses as defined in the current W3C Recommendation for HTML 5.2.
https://www.w3.org/TR/html/single-page.html#valid-e-mail-address

That will change in the next release of the W3C Recommendation for HTML 5.3 and will allow utf-8 in the local part of email addresses.
https://w3c.github.io/html/single-page.html#valid-e-mail-address

Drupal 7
The current validation of email addresses in Drupal 7 does not use HTML5 based client side validation and a server side validation based on PHP's filter_var() with the FILTER_VALIDATE_EMAIL filter which is based on RFC 822 and allows only a small subset of email addresses currently possibly in public use.

Example internationalized email addresses and the validity in D7/D8:

StructureStatus D7Status D8Example
ascii@ascii.newokokInfo1@ua-test.link
ascii@Ascii.longokokinfo2@ua-test.technology
ascii@Idn.asciifailokinfo3@普遍接受-测试.top
ascii@ascii.idnfailokinfo4@ua-test.世界
ascii@Idn.idnfailokinfo5@普遍接受-测试.世界
failokuasg.tech@डाटामेल.भारत
ascii@Idn-open dot-idnfailokinfo5@普遍接受-测试。世界
ascii@ascii.punycodeokokInfo4@ua-test.xn--rhqv96g
ascii@Punycode.asciiokokInfo3@xn----f38am99bqvcd5liy1cxsg.top
ascii@Punycode.punycodeokokInfo5@xn----f38am99bqvcd5liy1cxsg.xn--rhqv96g
ascii@RTL.asciifailokinfo6@ختبار-القبولالعالمي.top
ascii@RTL.RTLfailokuser@السعودية.رسيل
unicode@ascii.newfailok测试1@ua-test.link
unicode@Ascii.longfailok测试2@ua-test.technology
unicode@Idn.asciifailok测试3@普遍接受-测试.top
unicode@ascii.idnfailok测试4@ua-test.世界
unicode@Idn.idnfailok测试5@普遍接受-测试.世界
Unicode@ Idn-open dot-idnfailok测试5@普遍接受-测试。世界
unicode@ascii.punycodefailok测试4@ua-test.xn--rhqv96g
unicode@Punycode.asciifailok测试3@xn----f38am99bqvcd5liy1cxsg.top
unicode@Punycode.punycodefailok测试5@xn----f38am99bqvcd5liy1cxsg.xn--rhqv96g
unicode@RTL.asciifailok测试6@ختبار-القبولالعالمي.top
unicode@RTL.RTLfailokمستخدم@رسيل.السعودية

References:
https://uasg.tech/
https://en.wikipedia.org/wiki/International_email#Email_addresses
https://en.wikipedia.org/wiki/Email_address#Internationalization

Proposed resolution

Drupal 8
* Remove HTML 5 client side validation for the time being or wait until the specs update and the browser vendors adapt
Drupal 7
* Add Egulias\EmailValidator and use it for validation

Remaining tasks

Drupal 8
* Decide which way to go (wait or remove client side validation)
Drupal 7
* Add Egulias\EmailValidator and use it for validation #2343043: valid_email_address() should use egulias/EmailValidator and become deprecated

User interface changes

none

API changes

none

Data model changes

none

Release notes snippet

Original report by [username]


Viewing all articles
Browse latest Browse all 295035

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>