-
Notifications
You must be signed in to change notification settings - Fork 84
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
Spaces are accepted before @ sign #21
Comments
I also have another corner case which I would expect be caught: |
Checking for spaces is beyond this The philosophy of this lib is to be really light on validating the format of an email as that notoriously produces a lot of false alarms. Spaces are actually valid I believe in some cases, so I won't be adding that. If you want just regex I recommend validator. The latter complaint is fair though. This lib should definitely validate that the email should not end with deep-email-validator/src/regex/regex.ts Lines 10 to 13 in 7f34d7b
Should add if (domain.endsWith('.')) {
return 'Must not end with "."'
} |
I agree that you don't want to generate too many false alarms. Though I'd expect that spaces are only before or right after characters such as <> or "" that mark a readable name associated with the actual email. |
As discussed in mfbx9da4#21
https://stackoverflow.com/a/49153802 Isn't is a valid domain? So email should also be valid in this case. |
Hi,
I noticed that spaces are accepted before the @ sign of the email address, values such as "jo [email protected]", "john. [email protected]" or "john.doe @example.com" are not flagged as invalid, here is an example of result obtained:
This test is done with the following code:
I would expect it to fail at the regexp stage. For sure an address with a space in that part is refused by email servers.
Let me known if you need any more details.
Denis
The text was updated successfully, but these errors were encountered: