Email check (self-contained)

June 11, 2026 · View on GitHub

v0.79 · Inspired by check-if-email-existsour own MIT implementation, no npm/cargo dependency, no external backend.

Verify email quality without sending mail — for QA signup validation and notifyEmail preflight.

What MailAgent checks (built-in)

CheckHow
SyntaxLocal RFC-ish parse
Disposable (DEA)Local domain blocklist
Role accountadmin@, support@, …
MX recordsDNS-over-HTTPS (Cloudflare DoH)
isReachableDerived: invalid / risky / safe

What we do NOT check

SMTP mailbox existence (is this specific user@domain deliverable?) — Cloudflare Workers cannot open outbound port 25. That requires a separate SMTP probe service; we intentionally do not depend on one.

API

curl -s -X POST https://api.webmailagent.com/v1/emails/check \
  -H "Authorization: Bearer $MAILAGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"user@gmail.com"}'

Response source is always "local".

MCP

mailagent_check_email{ "email": "…" }

QA use cases

  1. Signup form rejects test@mailinator.comisReachable: invalid
  2. Domain without MX → invalid
  3. notifyEmail rejects disposable at inbox create

Contract

npm run test:contract:qa:email-check

vs check-if-email-exists (Reacher)

FeatureReacher (Rust)MailAgent (Worker)
Syntax
Disposable✅ (local list)
MX DNS✅ (DoH)
SMTP deliverability❌ (no port 25)
DependencyDocker / AGPL servicenone

We took the idea and response shape, not the git repo as a runtime dependency.