Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDN E-mail with username in Unicode is not accepted #668

Closed
rosmanov opened this issue Mar 25, 2016 · 2 comments
Closed

IDN E-mail with username in Unicode is not accepted #668

rosmanov opened this issue Mar 25, 2016 · 2 comments

Comments

@rosmanov
Copy link

Validation fails, if the E-mail username contains non-ASCII characters:

<?php
$m = new PHPMailer();
$m->CharSet = 'utf-8';
$m->ContentType = 'text/html';
$m->Encoding = 'base64';

$e = 'османов@письмо.рф';
$ep = $m->punyencodeAddress($e);
var_dump($ep);
var_dump($m->validateAddress($ep, 'pcre8'));

Actual output:

string(37) "османов@xn--h1aigbl0e.xn--p1ai"
bool(false)

Expected output:

string(37) "османов@xn--h1aigbl0e.xn--p1ai"
bool(true)
@Synchro
Copy link
Member

Synchro commented Mar 25, 2016

This is intentional, and mentioned in #88. UTF-8 in the local part of email adresses is only supported via RFC6531, and that has very little adoption as yet (pretty much only gmail). What's more of a problem is that if you use such an address and then try to send it via a server which doesn't support it, you're stuck with having to do everything in RFC6857, which really isn't pretty and requires architectural changes (because a message cannot be rendered until after you have connected to the server). As part of that process, punycode can be applied to the local part of addresses via RFC5891 and RFC5890, but support for that is even worse than for RFC6531.

In the absence of that support, we are back to RFC5321's definition of an email address, in which the address you're trying to use is not valid, as the validate function says.

In short, doing this is an enormous amount of work, so if you feel like writing it and doing a PR, be my guest.

@Synchro Synchro closed this as completed Mar 25, 2016
@UA2018
Copy link

UA2018 commented Nov 13, 2019

The Universal Acceptance Steering Group (UASG), supported by the Internet Corporation for Assigned Names and Numbers (ICANN), is a community-led, industry-wide initiative working on creating awareness and identifying and resolving problems associated with the universal acceptance of domain names. The purpose of these efforts is to help ensure a consistent and positive experience for Internet users globally.

You may find the following information useful in developing systems, internet applications that accept IDNs, EAI and New gTLDs.

Universal Acceptance Quick Guide:
https://uasg.tech/wp-content/uploads/documents/UASG005-en-digital.pdf

Good Practice Recommendations:
https://uasg.tech/wp-content/uploads/documents/UASG007-en-digital.pdf

Subscribe to the General Universal Mailing List https://mm.icann.org/mailman/listinfo/ua-discuss

You will find case studies and tools to test EAI on https://uasg.tech/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants