Skip to content
swancaPublic

About

Check whether a domain's email is set up to reach the inbox: SPF, DKIM, DMARC and MX, with every SPF include expanded and counted

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MailScope

Enter a domain and find out whether its email is set up to reach the inbox. Checks SPF, DKIM, DMARC and MX, expands every SPF include, and names what is broken.

Free tool, no account. The paid side is daily monitoring.

Why this exists

Email authentication fails silently. Nothing bounces, no warning is sent, and the only symptom is that more of your mail quietly lands in spam. The clearest example is the SPF ten lookup limit: nested includes spend from the same budget, so a record that reads as three includes can really be fourteen lookups, at which point SPF fails for your real servers too.

Running it

npm install
npm run dev
npm test                      # 76 tests, no network needed
MAILSCOPE_LIVE=1 npm test     # also runs the live DNS checks
npm run build
npm run deploy

How it is put together

Astro on Cloudflare Workers. Content pages are static, one API route runs on demand. No database. DNS goes through Cloudflare's public DNS over HTTPS resolver, which is free and needs no key, so the product has no running cost.

src/lib/
  spf.ts        Parsing plus recursive expansion with lookup counting
  dkim.ts       Key parsing, revocation and wildcard detection
  dmarc.ts      Tag parsing
  providers.ts  12 providers: detection, DKIM selectors, setup guides
  learn.ts      Explainer content for SPF, DKIM and DMARC
  dns.ts        DNS over HTTPS client, the only file that touches the network
  domain.ts     Input handling, accepts a domain, URL or email address
  check.ts      Orchestrates the checks and grades the result

src/pages/
  index.astro            The checker
  learn/[record].astro   SPF, DKIM and DMARC explainers
  setup/[provider].astro 12 provider setup guides
  api/check.ts           The check endpoint

Everything except dns.ts is pure, so the grading rules are tested exhaustively offline. That matters here more than usual, because the failures being detected are invisible in production.

Two traps worth knowing about

Both were found by running the checker against real domains, and both now have regression tests.

Revoked DKIM keys. A record with an empty p= means the key was revoked (RFC 6376), not that a key is present. Treating it as valid reports a pass on a domain with no DKIM at all.

Wildcard _domainkey. Some domains answer every selector you probe. Without deduplication the checker reports keys on all of them. usableKeys drops a set where every probed selector returned an identical record.

Honest limits

DNS gives no way to list DKIM selectors, so absence cannot be proven. The tool probes the selectors your provider is known to use and says how many it tried. The copy never claims a domain has no DKIM, only that none was found on the selectors probed.

House style

copy.test.ts fails the build on em dashes, curly quotes and stock marketing verbs.

Deploying

Run ./deploy-wizard.sh. Set PUBLIC_SITE_URL before the first deploy, since canonical tags and the sitemap are built from it.

Cost

No fixed cost. Cloudflare's free tier allows commercial use, and the DNS resolver is free. A domain is the only thing you have to buy.

About

Check whether a domain's email is set up to reach the inbox: SPF, DKIM, DMARC and MX, with every SPF include expanded and counted

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages