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 is way too restrictive #17

Closed
pib opened this issue Jan 27, 2014 · 1 comment
Closed

Email Validation is way too restrictive #17

pib opened this issue Jan 27, 2014 · 1 comment

Comments

@pib
Copy link

pib commented Jan 27, 2014

The regex '^\w+\@\w+\.[a-z]{2,3}$' is far too restrictive, as it doesn't allow for some very common things in emails, such as periods, dashes, plusses, etc.

[email protected] fails validation, as does [email protected], [email protected]. [email protected] passes, at least. All of these should pass, however.

I learned a long time ago to not even try to fully validate an email address just via regex. It's not really possible since you don't know if the domain really exists, or whether there is a mail server configured for that domain, and then of course, even if all that checks out, you don't know if that specific user exists on that server without trying to send an email there.

So, in conclusion, the email validator should really just be a basic sanity check along the lines of '^[^@]+\@[^@]+$' since users of the library are going to have to do further validation anyway, perhaps using something like Flanker's addresslib or just by sending a verification email.

@jaimegildesagredo
Copy link
Owner

Hi @pib! Thank you for opening this issue and helping to improve booby.

I just pushed a commit with your suggestion. I think that way it makes much more sense as you mentioned above.

This change will be included in booby 0.5.1 (I plan to release it this week, probably with #18 fixed as well).

Thank you again for your contribution ;)

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