How to clean an email list before you hit send (syntax, MX, disposable domains and typos)
Every bounced email chips away at your sender reputation. Send to enough dead addresses and Gmail and Outlook start routing your good emails to spam. Most bounces come from a handful of boring, fixable problems. Here's
Every bounced email chips away at your sender reputation. Send to enough dead addresses and Gmail and Outlook start routing your good emails to spam.
Most bounces come from a handful of boring, fixable problems. Here's what they are, how to catch each one yourself, and how to check a whole list in bulk.
The 5 things that break an email list
1. Bad syntax
jane@@company.com, jane@company, jane @company.com. These come from typos in forms and messy CSV exports. A regex catches most of them, but be careful: overly strict regexes reject valid addresses like [email protected].
2. Domains that don't accept mail
The address looks fine, but the domain has no mail server. Either the company shut down, or the domain never existed. You catch this with a DNS lookup for MX records:
import { promises as dns } from 'node:dns';
async function hasMx(domain) {
try {
const mx = await dns.resolveMx(domain);
return mx.length > 0;
} catch {
return false; // ENOTFOUND / ENODATA → no mail server
}
}
console.log(await hasMx('gmail.com')); // true
console.log(await hasMx('no-such-domain-zz9.com')); // false
Cache results per domain. A 10,000-email list usually has only a few hundred unique domains.
3. Disposable (throwaway) addresses
mailinator.com, yopmail.com, 10minutemail.com, guerrillamail.com... People use these to grab a freebie and never come back. They pass syntax and MX checks, so you need a list of known disposable domains (there are 10,000+).
4. Role accounts
info@, support@, sales@, noreply@. They're real inboxes, but they're shared, rarely read by one person, and more likely to mark you as spam. Flag them, don't necessarily delete them.
5. Domain typos
gmial.com, hotmial.com, yaho.com, company.con. These are the most frustrating because the person wanted your emails. Compare each domain against popular providers using an edit distance of 1. If it's that close, suggest the fix ("Did you mean [email protected]?") instead of rejecting it.
What about checking if the mailbox exists?
Some tools "ping" the recipient's mail server over SMTP to ask whether jane@ exists. Be skeptical:
- Many servers accept every address (catch-all) or refuse to answer, so the result is often "unknown".
- It sends traffic to someone else's mail server, which can get your IP flagged.
- Port 25 is blocked on most cloud providers anyway.
Syntax + MX + disposable + role + typo checks catch the majority of hard bounces without touching anyone's mail server.
Checking a whole list in bulk
Writing all of the above is a fun afternoon project. If you'd rather not maintain a disposable-domain list and typo tables, I published a ready-made version on Apify: Bulk Email Validator. You paste a list (or point it at a dataset), and every email comes back with a 0–100 score, a valid / risky / invalid verdict and the reasons.
Example result:
{
"email": "[email protected]",
"isValidSyntax": true,
"hasMx": false,
"isDisposable": false,
"isRoleAccount": false,
"typoSuggestion": "[email protected]",
"score": 45,
"verdict": "risky",
"reasons": ["no_mx_a_record_fallback", "possible_typo"]
}
You can call it from code too:
const res = await fetch(
'https://api.apify.com/v2/acts/rasareka~email-validator/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ emails: ['[email protected]', '[email protected]', '[email protected]'] }),
}
);
console.log(await res.json());
It costs $0.50 per 1,000 emails checked. It only verifies lists you already own; it doesn't find or scrape email addresses.
A simple cleaning rule of thumb
- invalid → remove (bad syntax, dead domain, disposable)
- risky → fix typos, review role accounts, then decide
- valid → send
Clean your list before every big campaign, not once a year. Your deliverability will thank you.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.