Hacker News new | ask | show | jobs
by fayden 4943 days ago
Why not use a librairy that validates emails? You save time, and you actually accept valid emails.

I agree that the example with a lot of symbols is over the top, but when a website doesn't accept foo+bar@host.com, I assume the product will be sub-par quality wise. The author did not follow of rigorous process for something as simple as email validation, I doubt he'll be more rigorous in other parts of his project.

2 comments

There are other concerns too. I submitted a bug report to Zappos because their emailer did not URL-escape '+' in foo+bar@example.com. Resulting in:

  http://www.zappos.com/?email=foo+bar@example.org
which was treated as:

  http://www.zappos.com/?email=foo%20bar@example.org
by the browser. It worked fine when I manually encoded the '+'.
I've given up on using + addresses. As other people have pointed out, the worst thing about them is that sometimes you will find that it works initially but will break other parts of the application now or later. For example, account creation works fine, but in two years, you can no longer log in.