Comment 3 for bug 1615280

Revision history for this message
Aaron Wells (u-aaronw) wrote : Re: Email validation bug (long domains)

After doing a quick survey of what other PHP projects are doing (including our own PHPMailer library), I think for now we should probably just use FILTER_VALIDATE_EMAIL throughout. As mentioned above, this is an improvement, but with the following known flaws:

1. No support for one-part domains (root@localhost)

2. No support for email addresses containing unicode characters (See https://en.wikipedia.org/wiki/International_email )

PHPMailer now includes a function to punycode the domain-part of an email address if it contains unicode, but it's not exposed as a static function, apparently because it's reliant on knowing the character set of the PHPMailer instance.

None of the big PHP projects currently support email addresses with unicode in the local part (before the "@"), although there are bugs raised with several of them, so we'll probably need to revisit this in a few years.