Skip to content
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

Email "////@////.////" is allowed #639

Closed
midgethoen opened this issue Sep 9, 2021 · 3 comments
Closed

Email "////@////.////" is allowed #639

midgethoen opened this issue Sep 9, 2021 · 3 comments

Comments

@midgethoen
Copy link

I'm not an expert but shouldnt this fail?

var zod = require("zod")

zod.string().email().parse('///@///.///')

https://runkit.com/embed/jnfvsg1uveyr

@scotttrinh
Copy link
Collaborator

Doesn't seem to violate the rules. I don't think email email string validation is supposed to replace actually testing that the email works through some kind of signup email flow, so hopefully your application is already handling technically valid but unknown email addresses like this. FWIW: I definitely don't think we should be in the business of validating TLDs or anything like that.

@colinhacks
Copy link
Owner

Turns out almost every damn thing is a valid email: https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression

And in any case it's better to err on the side of permissiveness here.

@midgethoen
Copy link
Author

Thanks for the responses,.

I though it might be because of the nature of email addresses. i tested it using my email client; which did complain:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants