-
Notifications
You must be signed in to change notification settings - Fork 13
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
RFC: is & valid in a domain? #7
Comments
If you look here: https://tools.ietf.org/html/rfc5322#page-13 ... you'll see that the domain part of an email address is allowed "&" and all sorts of other stuff (the "atext" definition). That makes it a "valid" email address, even though it is not actually a valid domain and you can't deliver to it. EmailAddressCriteria.DEFAULT disallows "ALLOW_DOMAIN_LITERALS", which is why it rejects as you expect, and apparently isValid() doesn't actually use DEFAULT by default. @bbottema -- perhaps "DEFAULT" is a misnomer here, since the default of isValid() is actually RFC_COMPLIANT, or perhaps the default for isValid() should actually be changed to DEFAULT. :-) |
Agreed, the naming is a little confusing. I will update this. |
Released in v1.1.0 |
Running a migration of and a user had registered with the domain
pg&e.com
. This passed my scrubbing usingisValid(email)
but failed during digestion due to json schema validator rejecting it. Switching toisValid(email, EmailAddressCriteria.DEFAULT)
rejects the address as well. Skimming over the RFC I couldn't tell if this was allowed and why & was accepted.The text was updated successfully, but these errors were encountered: