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 validation error in domain part #54

Open
thundergolfer opened this issue Dec 8, 2016 · 1 comment
Open

Email validation error in domain part #54

thundergolfer opened this issue Dec 8, 2016 · 1 comment

Comments

@thundergolfer
Copy link

In bouncer/src/bouncer/validators.cljx the email validation uses the following regex:

#"^[^@]+@[^@\\.]+[\\.].+"

I'm interested in that escaped backslash near the end. Why is it there? It allows the following email address to validate:

a@s\coom

I've checked this using an RPC822 validator here and it failed. I think a \ in the domain part is not part of RPC822 spec. Though the "/" is valid I think. The following email address passes that site's check:

hello@gmail/com

So yeah, is the escaped backslash supposed to be an escaped forward slash? What's the reasoning behind the backslash being allowed in the domain part?

Cheers

@Mhsmit
Copy link

Mhsmit commented Aug 17, 2018

Found the same issue
abc@hello.com@howare.you also works

Found this one that works for me and made a custom validation function
^(([^<>()\[\]\\.,;:\s@"]+(.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$

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

2 participants