News for hackers. Stuff that matters.
Re:How faulty checking for valid email addresses can hurt you by bdfh42 on Thursday June 11, 2009 @05:25AM (#652503)
My current policy on validating email addresses is to issue a warning if a given email address fails a check against a standard that covers the vast majority of addresses in use. Validating against the whole range of possible address content is near pointless. The warning simply asks the user to check their email in case of errors but allows a page submission following the display of that warning.
Re:How faulty checking for valid email addresses can hurt you by cperciva on Thursday June 11, 2009 @06:32AM (#652543)
My current policy on validating email addresses is to issue a warning if a given email address fails a check against a standard that covers the vast majority of addresses in use.

My policy on validating email addresses is "if I send you an email and it arrives, your email address is valid".

Why do you need to "validate" an email address? Knowing that an address is syntactically valid doesn't do anything to confirm that it will reach the intended target.

Re:How faulty checking for valid email addresses can hurt you by bdfh42 on Thursday June 11, 2009 @07:05AM (#652564)
You are correct - but - at your initial point of contact you have (perhaps) a single opportunity to make contact with your prospective customer. You should do all you can (without boring or annoying your prospect) to capture enough accurate information to ensure that the next step succeeds.

I agree - long term relationships are built on (in the context of this conversation) an exchange of emails but why blow it at the first hurdle?

Re:How faulty checking for valid email addresses can hurt you by Hexstream on Thursday June 11, 2009 @11:37AM (#652881)
"Knowing that an address is syntactically valid doesn't do anything to confirm that it will reach the intended target."

However, knowing that an address is syntactically invalid does confirm that it won't reach the intended target. If you don't mess up the validation.

Might be better than having the user wait infinitely for an important transactional email that will never arrive because of a dumb typo.

Re:How faulty checking for valid email addresses can hurt you by kree10 on Thursday June 11, 2009 @07:38AM (#652583)
Agreed. At [old job] we saw a lot of user-entered e-mail addresses that were "correct" (according to so-called validators) but wrong, like "[email protected]" or "example@yahoo".
Re:How faulty checking for valid email addresses can hurt you by ovi256 on Thursday June 11, 2009 @06:16AM (#652537)
The problem is that the RFC is amazingly permissive : almost anything goes in email adresses, including whitespace! A RFC-compliant regex is incredibly complex [1]. Furthermore, one would need to read not one, but five RFCs in order to grok everything: http://tools.ietf.org/html/rfc5322 http://tools.ietf.org/html/rfc3696 http://tools.ietf.org/html/rfc5321 http://tools.ietf.org/html/rfc4291#section-2.2 http://tools.ietf.org/html/rfc1123#section-2.1

[1] Great overview of the problem, plus a PHP validator. http://www.dominicsayers.com/isemail/

Re:How faulty checking for valid email addresses can hurt you by nailer on Thursday June 11, 2009 @08:32AM (#652622)
Mine is not to re-write the wheel. Writing a correct email address is indeed non-trivial, but there's at least one well known module written by someone who's actually read the RFCs and won't trash users using plussing and minusing. Use that, don't write your own.
Re:How faulty checking for valid email addresses can hurt you by yhnbgty on Thursday June 11, 2009 @12:52PM (#653068)
Depends on your customer base. It might be better to reject one show-off who managed to put a backspace in his email in return for helping 1000s of customers who enter [email protected]

It's possible to have a 6 character email address, but for most users checking that they have entered more than 6 chars would be good.