Live data from Hacker News

The Correct Way to Validate Email Addresses

hackernoon.com

141–150 of 405 posts

Re: The Correct Way to Validate Email Addresses

#141
I think the 'valid but wrong' email is a more common failure. Having just spent a few weeks with my wife trying to convince some poor person that they had mistyped their email address when they created their Amazon account. Reminded me of this xkcd (https://xkcd.com/1279/).

It does seem effective to have someone type the address twice as that can catch a typo fairly easily.

Re: The Correct Way to Validate Email Addresses

#142

No. Absolutely beginner level blog post. You would use a third party tool like http://www.datavalidation.com/ or mailgun's email validation service or BriteVerify etc etc. There are a ton of validation services now. We are living in a time when trillions of email addresses have been tried, entered and deployed to. So why reinvent the wheel on your website? 3rd party services are based not only on parsing the string b…

My philosophy is exactly the opposite. Allow anything as email address and make it as simple as possible for the user to sign up to use my application.

This means, no email validation, no address verification emails, heck, I don't even have a password confirmation field. One field for name, one for email and one for password and you are in.

If 10% of the users don't trust me with their real, or even throwaway email address, so be it. My goal is not to collect email addresses, but to have users use my application and add some value to their life.

If another 10% of them enter a mistyped email, they will figure it out eventually and change it if they care.

Re: The Correct Way to Validate Email Addresses

#143

I do a lot of optin email. Here are some examples of bounced emails that people use to sign up: * somename@gmail.co * anothername@yhoo.com * myemail@hotmial.com These are very common errors that occur nearly every day. A regex isn't going to help here. What does help, is a notification that asks people to verify what they typed –– if the email contains an obvious, common error, such as one listed above.

I'm planning a follow-up post with all sorts of real validation just like what you mention here. Can't take too long to build an array of 'probably typos'. I wish had access to logs of failed emails.

Re: The Correct Way to Validate Email Addresses

#144
post #142

No. Absolutely beginner level blog post. You would use a third party tool like http://www.datavalidation.com/ or mailgun's email validation service or BriteVerify etc etc. There are a ton of validation services now. We are living in a time when trillions of email addresses have been tried, entered and deployed to. So why reinvent the wheel on your website? 3rd party services are based not only on parsing the string b…

My philosophy is exactly the opposite. Allow anything as email address and make it as simple as possible for the user to sign up to use my application. This means, no email validation, no address verification emails, heck, I don't even have a password confirmation field. One field for name, one for email and one for password and you are in. If 10% of the users don't trust me with their real, or even throwaway email a…

eh, password confirmation at least has a valid reason to exist - kinda sucks when someone's first hit on your site is having to go through a recovery, and if they didn't provide an email address, they're screwed.

Re: The Correct Way to Validate Email Addresses

#145

The number of websites that try reject my email address with a + in it, ugh! Surprisingly, the validation is often done 100% client-side anyway, and simply modifying the incorrect regex lets my email address through... If I wrecked havoc on your back-end, then it's your fault for sucking ;)

Even worse is rejecting my password because it has a + in it! Why do you as a business care what my random password generator spit out?? Scarier still is when it's a server-side response that rejects my password for its contents...

An extremely large company I was involved in building a system for had a requirement that you be able to read your password over the phone to a call center agent, resulting in requirements like case insensitivity and character limits.

Terrible security, sure, but at least it came from the desire for usability, not just basic encryption idiocy.

Re: The Correct Way to Validate Email Addresses

#146

No. Absolutely beginner level blog post. You would use a third party tool like http://www.datavalidation.com/ or mailgun's email validation service or BriteVerify etc etc. There are a ton of validation services now. We are living in a time when trillions of email addresses have been tried, entered and deployed to. So why reinvent the wheel on your website? 3rd party services are based not only on parsing the string b…

/s? I seriously can't tell.

the idiots here eat up these moronic services.

see https://news.ycombinator.com/item?id=6109905

Re: The Correct Way to Validate Email Addresses

#147

Earlier quoted context omitted.

Even worse is rejecting my password because it has a + in it! Why do you as a business care what my random password generator spit out?? Scarier still is when it's a server-side response that rejects my password for its contents...

An extremely large company I was involved in building a system for had a requirement that you be able to read your password over the phone to a call center agent, resulting in requirements like case insensitivity and character limits. Terrible security, sure, but at least it came from the desire for usability, not just basic encryption idiocy.

No, the system isn't secure.

The text of the password should not persist.

Re: The Correct Way to Validate Email Addresses

#148
post #101

Correct way is run a regex for [wildcard @ wildcard . Wildcard] then send an opt-in email real-time as the user is typing additional info. If it bounces before the user finished the onboard form - alert them to the issue. If it gets validate, autologin the user. If bounces or there's zero response by the time the user completes the form, alert them, ask to type their email again without access to the reprior entry -…

Polling email on the server is awfully wasteful. I like the "request an invite" pattern. Get an email address and nothing more, send the "invite", clear the form, tell them if they don't get an email in 5 minutes, check spam, still nothing, reenter the email. Don't associate the link with any particular session, just the entered address so there is no risk of leaking any private info, if they type in an address that actually belongs to someone else the only options the other person would have is ignore the email or sign up themselves. When they finally get their email right they'll get a link to a place where they can fill in the rest of the info and you can be assured they gave you the email address they wanted you to have.

Re: The Correct Way to Validate Email Addresses

#149

Earlier quoted context omitted.

An extremely large company I was involved in building a system for had a requirement that you be able to read your password over the phone to a call center agent, resulting in requirements like case insensitivity and character limits. Terrible security, sure, but at least it came from the desire for usability, not just basic encryption idiocy.

No, the system isn't secure. The text of the password should not persist.

Who said the text persists, you could take it off the phone and type it in to compare against any existing salted hash. Still not good security, but not necessarily stored in plaintext.

Re: The Correct Way to Validate Email Addresses

#150

Earlier quoted context omitted.

Even worse is rejecting my password because it has a + in it! Why do you as a business care what my random password generator spit out?? Scarier still is when it's a server-side response that rejects my password for its contents...

> Scarier still is when it's a server-side response that rejects my password for its contents... A friend's project decided to disallow umlauts, combined characters like ´e (can't type the correct e with accent mark), the pipe symbol and a couple more in new passwords. Not due to plaintext storage or so, but because of customer service issues - people were bugging support all the time because they were e.g. abroad an…

I'm looking forward to the date when some clueless user will input a UTF8 emoji as a password, given that Android and iOS keyboards now include these on special keyboards...

Looking forward? That happened a year ago and caused problems because the OS X Yosemite login screen had no way to input emoji:

http://apple.stackexchange.com/questions/202143/i-included-e...

Post reply on HN