Live data from Hacker News

Email address validation: please stop

blog.sinjakli.co.uk

41–50 of 86 posts

Re: Email address validation: please stop

#41
post #22

Earlier quoted context omitted.

The relevant RFCs make it clear what is a correct eMail address. Why should we have to put with lazy or incompetent coders who can't be bothered to meet the standard?

Yeah but not all email addresses are RFC compliant. Plenty of mail servers accept, or can be configured to accept, non-compliant addresses.

That's not the issue at hand - the grandparent comment advocates that you shouldn't even expect a service to accept RFC-Compliant addresses.

Validating against the RFC is more, not less permissive than the position held by the grandparent comment.

Re: Email address validation: please stop

#42
post #40

Earlier quoted context omitted.

The point here is that "the pattern" used by developers is often grossly incorrect. It'd be better to not even attempt to enforce any pattern.

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?

Re: Email address validation: please stop

#43
post #20

Earlier quoted context omitted.

The problem with matching against the fully fledged RFC compliant regex is that not all email addresses are RFC compliant. As I indicated in my comment above, I've abondoned trying to "correctly" or "completely" validate email addresses. There's onyl one thing certain in an email address: it contains the "@" character.

Cam you give an example of a noncompliant address that actually works?

One cellular phone company in Japan used to allow people to register e-mail addresses with two periods in a row before the @ character. I have seen some addresses like this in the wild, but the decision to mark these as valid or not for an app depends on the domain you're working in. At my old job making web apps for Japanese companies, programmers would usually allow these types of addresses if we were making a mobile site.

Re: Email address validation: please stop

#44
post #41
post #22

Earlier quoted context omitted.

Yeah but not all email addresses are RFC compliant. Plenty of mail servers accept, or can be configured to accept, non-compliant addresses.

That's not the issue at hand - the grandparent comment advocates that you shouldn't even expect a service to accept RFC-Compliant addresses. Validating against the RFC is more, not less permissive than the position held by the grandparent comment.

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

Re: Email address validation: please stop

#45
post #41
post #22

Earlier quoted context omitted.

Yeah but not all email addresses are RFC compliant. Plenty of mail servers accept, or can be configured to accept, non-compliant addresses.

That's not the issue at hand - the grandparent comment advocates that you shouldn't even expect a service to accept RFC-Compliant addresses. Validating against the RFC is more, not less permissive than the position held by the grandparent comment.

Yup, agreed. And of course RFC compliance only specifies syntax. It would pass blah@blah.hlah.

Re: Email address validation: please stop

#46
post #27

Earlier quoted context omitted.

How can other people work out what you mean by a 'legit' email address? Are hyphens allowed? What about dots, underscores or numbers? Do any of those count as "super-special characters"? Just like "+", they are all permitted in standards-compliant email addresses, but I have no way of knowing whether they are permitted in addresses that you consider "legit".

Exactly. You have no way of knowing what all the code along the way between the mail-sending application and your inbox does, that was my whole point.

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 code along the way does, but you can at least hope that it behaves in something resembling a standards-compliant fashion. Otherwise, what's the point of email addresses at all?

Re: Email address validation: please stop

#47
A loosely related anecdote:

I was registering a general purpose domain name a couple of years back and asked a friend if he had any input on a good short name. He replied "nope", and being a Swede I registered nope.se.

There was a time I still forwarded all nope [at] nope [dot] se emails to my primary email, but as it turned out (not that unexpected), this was an address frequently used by Swedes to register "anonymously".

Anyway, it was an interesting/alternative way of keeping track of popularity of new communities etc. Clearly not all users expected that they had to verify their email addresses.

Re: Email address validation: please stop

#48

While I agree that some kinds of validation are 'too eager' and annoying, just use a 'legit' e-mail address, ffs. By including super-special characters and whatever extra features GMail or whoever provides, you're just asking for it, sorry. Especially if you're a coder yourself, you can already assume that even if it passes the initial validation, it probably won't be properly stored or escaped when the actual mail i…

The relevant RFCs make it clear what is a correct eMail address. Why should we have to put with lazy or incompetent coders who can't be bothered to meet the standard?

You probably got me wrong. In a perfect world, it would work just as specified in the RFC, everywhere and I am all for that. But obviously that's not the case.

And I am not encouraging people to be lazy and sloppy, I am just saying considering the 'real world', you are better off with an email-address that does not contain any too unusual characters (e.g. - _ . should be fine, as those are commonly used).

Re: Email address validation: please stop

#49
post #41

Earlier quoted context omitted.

That's not the issue at hand - the grandparent comment advocates that you shouldn't even expect a service to accept RFC-Compliant addresses. Validating against the RFC is more, not less permissive than the position held by the grandparent comment.

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?

Re: Email address validation: please stop

#50

Please stop... to collect email addresses you don't really need. When I participate in some kind of online community, I want to chose if I receive emails from them at all. And if not, it should be my choice if I provide any email address at all. I have a small site where you can participate anonymously or log in, and when you create an account it's your choice if you provide an email address at all. If not, and you l…

Thats true for many things, but often money is involved (say amazon or some other online shop).

And telling your customer that they are out of luck may not be acceptable.

Post reply on HN