mxprobe-core
The MX Probe engine. Zero dependencies, Node 20+. Two tiers:
- DNS. Free and local. Finds every domain that cannot receive mail: no MX
and a web host behind the A record, a null MX, an MX that does not
resolve, a domain that does not exist, a parking host as MX. Forwarder MX
hosts (Cloudflare Email Routing, Namecheap, ImprovMX) are a
hold.
- SMTP probe. Connects to the MX on port 25, EHLO, MAIL FROM, RCPT TO for
the address and for a random local part (the catch-all test), QUIT. No
message is ever sent. Needs outbound port 25, which most laptops and
clouds block; the hosted API at https://api.mxprobe.dev runs it for you.
import { verify, verifyBatch, createVerifier } from "mxprobe-core";
await verify("hello@example.com");
await verifyBatch(["a@b.com", "c@d.org"], { smtp: true, helo: "probe.example.com", from: "probe@example.com" });
const v = createVerifier({ smtp: true, smtpConcurrency: 3, autoDisableSmtp: false });
checks.smtp is skipped on the DNS tier, else accepted, rejected,
refused, deferred, unreachable or dropped. Only rejected (a 5xx that
names the mailbox) kills; everything else that is not accepted holds.
Options (all optional): smtp, helo, from, port, hostOverride,
dnsTimeoutMs, smtpTimeoutMs, smtpConcurrency, dnsConcurrency,
autoDisableSmtp, resolver (an object with resolveMx, resolve4,
resolve6, reverse, for tests).
Written in TypeScript; the package ships its declarations. VerifyResult,
Action, Verdict, SmtpCheck, Checks, Summary, VerifierOptions,
Resolver and the hosted API's response types (SignupResponse,
VerifyResponse, BalanceResponse, CheckoutResponse, ApiErrorBody)
are exported as types.
MIT. Part of https://github.com/andrewchmr/mxprobe.