-
Notifications
You must be signed in to change notification settings - Fork 65
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
ACE representation of email address with IDN considered invalid #87
Comments
Yeah, I see what you are saying. International Domain Names (IDN), when ASCII-Compatible Encoded (ACE), are getting double dashes in them. I think that is why they are getting rejected in |
https://github.com/K-and-R/email_validator/blob/develop/lib/email_validator.rb#L126-L128 I expected GitHub this to include the lines of code (below) just by adding in the link to them (above). It did not, so here they are: def label_contains_no_more_than_one_consecutive_hyphen
'(?!.*?--.*$)'
end |
So, this behavior is very much intentional, but may be a mistake. Let me look at the RFC again. |
So, I am thinking that rejecting consecutive hyphens was my mistake. I cannot see where they are not allowed in domain names. I do see that India's Domain Registration Service does say that:
In fact, RFC 3696 clearly indicates that double hyphens preceded by "xn" should be expected. So, definitely a bug. Thank you for bringing it to my attention. |
@manuelmeurer Fixed in version |
Brilliant, thanks so much for the quick fix! ❤️ |
When I enter an email with an IDN like "test@umläut.com" in a form in my Rails app and submit it, the backend receives the ACE representation "test@xn--umlut-ira.com", which is considered invalid by email_validator in strict mode:
Is this a bug?
The text was updated successfully, but these errors were encountered: