Red Hat Bugzilla – Bug 982048
RFE: Use <better email validator> to conform to RFC2822
Last modified: 2015-07-30 21:19:50 EDT
Description of problem:
Non unicode characters not rejected by email validation
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Go to $server:port/zanata/account/register
2. Enter あいうえお@example.com into the email field, press Tab
3. Bug: No "not a well-formed email address" message
4. Fill out the rest of the fields, press Register
Unexpected error. Please try again. [ Request: ? ]
Should have been rejected on the Register page via field validation
Along with the above example, the inline email validation fails to recognise many other invalid entities (e.g. email@-domain.com) - though these seem to be picked up afterwards by java mail handling.
More importantly, however, is that valid email addresses are being rejected - such as:
"email"@domain.com (quoted strings are acceptable)
email@[domain.com] (bracketed domains are acceptable)
A test should be devised to handle all of the cases from the front-end and the validation upgraded to comply.
As mentioned in the Hibernate EmailValidator docs, it may not be worth trying to catch everything: http://docs.jboss.org/hibernate/validator/4.3/api/org/hibernate/validator/internal/constraintvalidators/EmailValidator.html
It is better to let an invalid address through to the mail system, than to disallow a user's valid address.
However, to handle the edge cases better, we could replace or augment Hibernate EmailValidator with an implementation which calls JavaMail's "new InternetAddress(email).validate()"
Reassigned to PM
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-432