TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The 100% correct way to validate email addresses

2 pointsby beefhashover 4 years ago

2 comments

elmerfudover 4 years ago
I apparently have an email address that people either mistype often or put in thinking it is funny&#x2F;bogus. I&#x27;m for this idea of sending an activation email to verify it, but not just a simple activation email it needs to have a few features in it.<p>First, it needs to not contain any personal information because why would you send personal info to address that&#x27;s not verified. Next, verification should be more than clicking the link or typing a code. I should have to click the link or enter the code on the browser that I&#x27;ve already logged in with. There&#x27;s major sites that don&#x27;t do this and I&#x27;ve been able to verify, then reset the password to someone&#x27;s account. Basic security thought process needs to go in to this chain of events to verify an email that can reset passwords. Finally there needs to be a link to indicate that it&#x27;s a wrong email. There&#x27;s spam places that use this to capture emails, but when big names don&#x27;t offer this feature it boggles the mind.
orduover 4 years ago
As I understand, the goal of validating e-mail syntactically, is a defense against various attacks based on injection of malicious data&#x2F;code. One wants to restrict what might be entered by a user, to forbid something like &quot;hello@example.com; sh -c sudo rm -rf &#x2F;* &amp;;&quot;. Or maybe strings which interfere with SMTP to send spam mail from site address.<p>Such a validation have to occur at some point before SMTP commands have been written into smtp-socket. If underlying code to send an email is safe against invalid email addresses, then there are no much reason to validate address before passing it to underlying code, but this safety could be reached only by validating address by underlying code.