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.

Show HN: Deep Email Validator

51 pointsby mfbx9da4over 4 years ago

10 comments

runlevel1over 4 years ago
Presence of an MX record should _not_ be used as a litmus test for a valid email domain.<p>RFC 5321 section 5 specifies that you lookup the MX and, if absent, use the A&#x2F;AAAA record. I&#x27;m simplifying a bit, but that&#x27;s the gist of it.<p>Using just the A record is more common than you might expect.<p>[1]: <a href="https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc5321#section-5" rel="nofollow">https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc5321#section-5</a>
nickjjover 4 years ago
The first line mentions:<p>&gt; Validates email looks like an email i.e. contains an &quot;@&quot; and a &quot;.&quot; to the right of it.<p>But what about emails coming from a hostname without a dot, or a TLD without a subdomain?<p>Even the HTML email field supports emails without a dot after the @ because it&#x27;s technically valid.
评论 #25442185 未加载
评论 #25441904 未加载
评论 #25442221 未加载
评论 #25441896 未加载
评论 #25442173 未加载
评论 #25442305 未加载
madsbuchover 4 years ago
For most applications email validation is really not nesecarry. instead a service can rely on email verification. If the address is invalid, mails sent to it will never arrive at a destination.
评论 #25452090 未加载
评论 #25494696 未加载
评论 #25443538 未加载
bo1024over 4 years ago
You might save a little bit of confusion by calling it an email &quot;address&quot; validator.
sdfhbdfover 4 years ago
Hopefully this doesn&#x27;t get used in some kind of registration flow in full since for example if you register with an aliased address, or you have a catchall address or email is just proxied the SMTP checks would fail.
评论 #25442805 未加载
jedbergover 4 years ago
There is exactly one right way to validate an email: send a message to it.<p>Email is a very old protocol with a lot of hacks and backwards compatibility. At this point, pretty much any string <i>could</i> be a valid email address. You can certainly run a bunch of tests and get a decent signal, but it&#x27;s a lot of work, and if you reject an email address without testing it you&#x27;re going to cause someone some trouble at some point. It&#x27;s a lot easier and more accurate to just accept the string and try to send email to it.
评论 #25494633 未加载
amaurymartinyover 4 years ago
Interesting, I wrote a similar tool some time ago, in Rust: [link redacted]<p>I&#x27;m using a similar technique to check deliverability, i.e. parsing SMTP responses.
293984j29384over 4 years ago
I&#x27;m not a big fan of denying disposable email services. For that reason, I&#x27;ll pass.
评论 #25494636 未加载
that_guy_iainover 4 years ago
I bet this would fail on my catch all email since it checks if the mailbox exists, right?
评论 #25446415 未加载
ketamine__over 4 years ago
How does it handle timeouts?
评论 #25494650 未加载