-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Discrepancies between isValid and normalizeEmail #825
Comments
Agreed, this is confusing behavior of |
@chriso i want to work on this issue but i have some questions:
|
@tux-tn [email protected] is an invalid gmail address. I think we should add domain-specific validation given how ubiquitous gmail addresses are. |
According to this post, there are gmail addresses out in the wild that have a username part less than six characters. It's an edge case, but it's possible we ran into one of these today, and now I am faced with having to disable email validation altogether because it is trying to be too clever. |
So there are situations where isEmail will return
true
, but normalizeEmail will return false.For example:
[email protected]
-> isEmail returns true, normalizeEmail returns false.Really this comes down to a behavior that I think the library should enforce:
Currently
normalizeEmail
can returnfalse
, which seems wrong. It feels like ifnormalizeEmail
can't do what it needs to it should return the original string ornull
?Extend isEmail?
Currently normalizeEmail is actually doing domain-specific email validation as well as normalizing the email. For example [email protected] is syntactically valid, but invalid for gmail. Maybe
isEmail
should also be extended to contain this domain-specific logic to bring it into line with what normalizeEmail is doing.The text was updated successfully, but these errors were encountered: