Live data from Hacker News

Email address validation: please stop

blog.sinjakli.co.uk

61–70 of 86 posts

Re: Email address validation: please stop

#61
post #46

Earlier quoted context omitted.

But how can I be considered to be "asking for it" if I put a dot, hyphen or number in my email address, when millions of email addresses have them; the standard permits them; and many institutional policies create emails with them by default? Which characters can I have in my email address, that won't cause you to tell me it's my own fault when they get rejected? I agree that you have no way of knowing what all the c…

I am not sure whether relying on 'hope' is a good approach.

Hope is all you have, if email is the black box wilderness you describe. You rely on hope regardless of whether or not your email address contains "super-special characters".

My whole point is that there is a standard for an email address, outlined in a freely-available document. If an application claims to handle email, that claim implies conformance to that standard. Any deviation should be documented.

Your claim appears to be that there is some other definition of a "legit" email address, that you can absolutely 100% guarantee will be handled by absolutely every single email-handling application ever (without relying on hope).

Please answer these questions -

1) What, exactly, is the format of such a "legit" email address, according to your definition?

2) Where does this definition come from?

Re: Email address validation: please stop

#62

You should first ask yourself if you really need an email address. And see if you can get away with not having one. Requiring that the user have an email on file is not as necessary a requirement as a lot of people seem to think. It seems like half the time or more, they just want to spam it anyway.

Honest question: how do you handle the extremely common case of a lost password without an email address?

Re: Email address validation: please stop

#63
post #40

Earlier quoted context omitted.

Optimize for a few hundred spam obsessed power users, or, prevent a major cause of the #2 most common CS complaint at many businesses. This does not take much pondering. P.S. Trivially A/B testator at high volumes if your CS infrastructure is capturing sufficient data.

Which part of this is the #2 complaint - users making a mistake entering in their email address? Isn't this why you ask them to confirm it by sending them an activation email?

The activation email isn't a panacea for users fumble fingering (or misremembering, or not knowing) their email address. Users who don't receive it will either a) ignore it if you let them use the application anyway or b) frequently bounce hard if they don't get it, because they assume naturally that your Googles are broken.

The single most compelling reason to send people activation emails is -- I kid you not -- to remind them that they signed up for your website and how to get back to your website. A secondary consideration is not proving that they got their inbox right but proving that they didn't get someone else's inbox wrong.

Re: Email address validation: please stop

#64
post #51

Earlier quoted context omitted.

Too loose for what though? To make it more useful as a communication format or to make it easier for developers to validate it? It's hard to believe that a tighter spec could have improved the former.

Well for starters, why do you need to put comments in your email? That can't be used to make it more useful as a communications format.

I'm afraid I don't understand your question

Re: Email address validation: please stop

#65

What's even worse is when they have different validations in different places. I've had ticketmaster accept my name+tm@gmail.com email at sign up, only to never let me log in after that first time.

I ran into this with a flight reservation system. I lost hundreds of dollars and missed my flight when the front end accepted my email address but the back end didn't send me a confirmation.

A plausible explanation given to me was that the web application worked just fine, but it sent the data to some COBOL-ish back end written long before the advent of web bookings, and the integration code mangled my email address when it stuffed it into some data field that was never intended to hold an email address.

This is why any real-world system needs end-to-end integration testing and not just unit testing :-)

Re: Email address validation: please stop

#66
post #62

You should first ask yourself if you really need an email address. And see if you can get away with not having one. Requiring that the user have an email on file is not as necessary a requirement as a lot of people seem to think. It seems like half the time or more, they just want to spam it anyway.

Honest question: how do you handle the extremely common case of a lost password without an email address?

As someone else mentioned in the thread, make the email address optional, with the understanding that without it they can't recover lost passwords.

This is probably an unacceptable solution for some sites, but I can definitely think of cases where the only reason you need email is for password recovery, and account loss isn't the end of the world.

Re: Email address validation: please stop

#67
post #61

Earlier quoted context omitted.

I am not sure whether relying on 'hope' is a good approach.

Hope is all you have, if email is the black box wilderness you describe. You rely on hope regardless of whether or not your email address contains "super-special characters". My whole point is that there is a standard for an email address, outlined in a freely-available document. If an application claims to handle email, that claim implies conformance to that standard. Any deviation should be documented. Your claim a…

Your view of this whole subject seems to be completely upside down.

There's no such thing as a 100% guarantee when it comes to email (Interwebs 101) but it should be completely obvious to any sane person that you are getting much closer to those 100% if you don't use any "super-special characters" in your e-mail address as opposed to people "asking for it" by using an address like {^|~!}@gmail.com - which will obviously get you into some kind of trouble, sooner or later, whether it's Facebook's validation rejecting it or mail applications which can't handle it properly.

So of course, while there can't be 100%, from the perspective of an application that deals with e-mails, you'd want to get as close as possible. And like I said in an earlier comment, I wouldn't expect problems with characters such as - _ . but yeah, who knows?

And actually, there's no way anyone could ever have that obscure example address used above, as hey surprise, GMail won't allow you to register it (same for Hotmail). So, I am not sure what this means now:

GMail only allows alphanumeric characters and dots in mail addresses because...

a) ...their coders don't know the RFC and hardly anything about that whole e-mail thing in general, so they provided us with a heavily flawed product, according to your definition.

b) ...their coders have already been doing this whole development and e-mail thing for a week or two and it was obvious to them that "super-special characters" could lead (and have previously led) to trouble, so they're saving less 'techy' people from registering addresses that are basically "asking for it".

Ever since the first comment I left here, my whole point is that everyone who has built applications sending a lot of e-mails just knows that it's insane to assume that everybody else "does it right" and that combinations of special characters, escaping and UTF-8 often result in 'lots of fun'... not. That's far from being fully RFC-compliant but that's how it is, out there in the wild.

One last example: according to Wikipedia, Hotmail "refuses to send mail to any address containing any of the following standards-permissible characters: ! # $ % * / ? ^ ` { | } ~". (And being aware of this, you'd be "asking for it".)

Re: Email address validation: please stop

#68
post #51

Earlier quoted context omitted.

Well for starters, why do you need to put comments in your email? That can't be used to make it more useful as a communications format.

I'm afraid I don't understand your question

Then you are unfamiliar with email address formats, which have a specific formatting that allows for "comments", and it is kind of hairy.

Re: Email address validation: please stop

#69
post #15

The "+" feature of gmail is great, but I hesitate to use it after some weird validation problems I've had. I've stopped asking that people validate properly, and started hoping that they a) don't validate or b) fail gracefully. One (very important) site properly validated my "+" email address on the front end (gave me no errors), but the backend failed and I never received the required confirmation email... all resul…

Shouldn't the spammers have figured out the "+" feature by now? Just remove it and the suffix to get a valid address, for gmail or any other provider that uses the syntax.

return Regex.replace(email, "([^\+])°[^@]°(@.°)$", "$1$2")

° should be * but HN eats it as markup.

Re: Email address validation: please stop

#70

Earlier quoted context omitted.

Well, just go ahead and try signing up at facebook with {^|~!}@gmail.com then.

So because Facebook don't know what counts as a valid eMail address, everyone else has to adapt to them?

When that's the behavior of the 800-pound gorilla, then the answer is yes. IE6 didn't know what counts as valid DOM or CSS but everybody else adapted to it.
Post reply on HN