🐧 Linux TippsDebian 11 Long Term Support reaches end-of-life(31.08.2026 um 02:00 Uhr)
🐧 Linux TippsUpdated Debian 13: 13.7 released(12.09.2026 um 02:00 Uhr)
🕵️ SicherheitslückenUSN-8741-1: Flatpak vulnerabilities(10.09.2026 um 10:44 Uhr)
🕵️ SicherheitslückenUSN-8742-1: Netty vulnerability(10.09.2026 um 11:01 Uhr)
🕵️ SicherheitslückenUSN-8737-2: GNU C Library vulnerabilities(10.09.2026 um 13:25 Uhr)
🕵️ SicherheitslückenUSN-8743-1: PHP vulnerabilities(10.09.2026 um 13:48 Uhr)
🕵️ SicherheitslückenUSN-8744-1: Python vulnerabilities(10.09.2026 um 15:53 Uhr)
🐧 Linux TippsUSN-8748-1: Linux kernel (NVIDIA) vulnerabilities(10.09.2026 um 17:32 Uhr)
🕵️ SicherheitslückenUSN-8745-1: KissFFT vulnerabilities(10.09.2026 um 17:36 Uhr)
🕵️ SicherheitslückenUSN-8746-1: libEBML vulnerability(10.09.2026 um 17:48 Uhr)
🐧 Linux TippsDebian 11 Long Term Support reaches end-of-life(31.08.2026 um 02:00 Uhr)
🐧 Linux TippsUpdated Debian 13: 13.7 released(12.09.2026 um 02:00 Uhr)
🕵️ SicherheitslückenUSN-8741-1: Flatpak vulnerabilities(10.09.2026 um 10:44 Uhr)
🕵️ SicherheitslückenUSN-8742-1: Netty vulnerability(10.09.2026 um 11:01 Uhr)
🕵️ SicherheitslückenUSN-8737-2: GNU C Library vulnerabilities(10.09.2026 um 13:25 Uhr)
🕵️ SicherheitslückenUSN-8743-1: PHP vulnerabilities(10.09.2026 um 13:48 Uhr)
🕵️ SicherheitslückenUSN-8744-1: Python vulnerabilities(10.09.2026 um 15:53 Uhr)
🐧 Linux TippsUSN-8748-1: Linux kernel (NVIDIA) vulnerabilities(10.09.2026 um 17:32 Uhr)
🕵️ SicherheitslückenUSN-8745-1: KissFFT vulnerabilities(10.09.2026 um 17:36 Uhr)
🕵️ SicherheitslückenUSN-8746-1: libEBML vulnerability(10.09.2026 um 17:48 Uhr)

🔧 Programmierung 🕛 vor 2 Monaten 3 Min Lesezeit
0

Stop validating emails with regex: here's what to do instead

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Almost every codebase I've touched has some version of this line:




CODE
const ok = /^[^@]+@[^@]+\.[^@]+$/.test(email);






It feels like email validation. It isn't. Here's what that regex actually misses, and a more honest way to check an address before you trust it.






1. Regex only checks shape, not reality



[email protected] passes most regexes. So does [email protected] (a disposable address) and [email protected] typed as [email protected]. Your regex says "valid" to all three. Your signup funnel, your transactional email, and your deliverability rate disagree.



The full RFC 5322 grammar for a valid address is famously monstrous, and even the correct version tells you nothing about whether mail will actually arrive.






2. The four checks that actually matter



Instead of one regex, think in layers, cheapest first:





  1. Syntax — a sane subset, not the full RFC. Catch the obvious garbage.


  2. Disposable / role detection — is the domain a throwaway (mailinator.com, 10minutemail) or a role inbox (admin@, support@)? These wreck your engagement metrics.


  3. Typo suggestionsgmial.com to gmail.com, yaho.com to yahoo.com. One of the highest-ROI fixes for signup conversion.


  4. MX / deliverability — does the domain actually publish mail servers (MX records)? If there's no MX, nothing you send can ever land.



That last one is the step people skip, because it needs a DNS lookup rather than a string test.






3. Doing the MX check



In Node you can do it yourself:




CODE
import { promises as dns } from 'node:dns';

async function hasMx(domain) {
try {
const records = await dns.resolveMx(domain);
return records.length > 0;
} catch {
return false;
}
}






That's the core idea. In a browser or edge function you don't have raw DNS, so you'd hit a small endpoint that does the lookup for you.






4. A hosted version, if you don't want to build it



I got tired of re-implementing these four layers, so I put them behind one free GET call. Sharing in case it saves you the same afternoon:




CODE
GET https://verify-api.cchkjjdobby.workers.dev/[email protected]









CODE
{
"domain": "mailinator.com",
"is_disposable": true,
"has_mx": true,
"status": "disposable",
"deliverable": false
}






CORS is enabled and it runs on Cloudflare Workers with no paid external calls, so the free tier is genuinely free. There's a no-signup UI too if you just want to paste an address and see the layers: https://tools-site.cchkjjdobby.workers.dev






Honest limitations



An MX check confirms the domain can receive mail — it can't guarantee a specific inbox exists without sending something. And you should never hard-block a signup on a typo guess; suggest, don't reject.



That's the trade-off: cheap layered checks catch most bad addresses before they cost you, and you accept that the last mile (does this exact mailbox exist) needs an actual send.



What does your stack do for this today — roll your own, or pay for a validation SaaS? Curious what the breaking point is where people decide to pay.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Debian 11 Long Term Support reaches end-of-life
1 Quelle
Updated Debian 13: 13.7 released
1 Quelle
USN-8741-1: Flatpak vulnerabilities
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Stop validating emails with regex: here's what to do instead

Thematisch verwandte Begriffe: Stop, validating, emails, with · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...