Skip to content

Deliverability

Live A–F DNS audits, pre-send spam scoring, complaint feedback loops (RFC 5965 ARF / JMRP), and automated IP warm-up with failover overflow.

DNS health audit (A–F)

GET/api/v1/deliverability/domains/{id}/auditRequires domains:read

Looks up live DNS records for a domain, scores authentication health from 0 to 100 (graded A to F), and returns a prioritised list of paste-ready DNS fixes:

  • SPF (25 pts): Detects missing or duplicate SPF records, rejects +all, walks the full recursive include tree against RFC 7208's 10-DNS-lookup limit, and checks for MTAKIT_SPF_HOST.
  • DKIM (30 pts): Verifies the selector record exists, matches the RSA-2048 key MTAKit signs with, checks key length, and flags lingering t=y test flags.
  • DMARC (35 pts): Inspects policy, pct, subdomain policy (sp), and external rua authorisation, guiding progressive rollout: p=none → p=quarantine; pct=25 → p=quarantine → p=reject.
  • BIMI (5 pts) & MTA-STS / TLS-RPT (5 pts): Validates DMARC enforcement prerequisites, HTTPS SVG Tiny-PS logo, VMC readiness for Gmail and Apple Mail, and optional inbound TLS reporting.
curl https://mail.example.com/api/v1/deliverability/domains/0a4d9a52-0a8e-4f4e-b4f7-6f4f6a2f9a11/audit \
  -H "Authorization: Bearer $MTAKIT_API_KEY"

Pre-send spam gate

POST/api/v1/deliverability/spam-checkRequires emails:send

A deterministic sub-millisecond content and header linter. Lower scores are better: scores 3.0 and above return a warning, and 5.0 and above indicate likely spam.

curl -X POST https://mail.example.com/api/v1/deliverability/spam-check \
  -H "Authorization: Bearer $MTAKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <orders@acme.com>",
    "subject": "Order 94821 confirmed",
    "html": "<p>Your shipment is scheduled for tomorrow.</p>",
    "text": "Your shipment is scheduled for tomorrow.",
    "stream": "transactional"
  }'

The same check also runs automatically inside POST /api/v1/emails. Control enforcement per request via the X-MTAKit-Spam-Check header or globally with MTAKIT_SPAM_CHECK_MODE:

ModeBehaviour
reportDefault. Attaches spamCheck: { score, verdict, rules } to the 202 response without blocking.
enforceRefuses messages scoring at or above MTAKIT_SPAM_BLOCK_SCORE (default 5) with HTTP 422 and full rule details.
offSkips the pre-send content linter.

Complaint feedback loops (FBL)

MTAKit automatically adds a Feedback-ID header to outbound emails so Google Postmaster Tools can group complaints by tenant and stream.

POST/api/v1/deliverability/fblHMAC signature

Authenticated via X-MTAKit-Signature: sha256=<hex> keyed with FBL_WEBHOOK_SECRET (falls back to INBOUND_WEBHOOK_SECRET). Accepts:

  1. Raw complaint report emails (RFC 5965 ARF or Microsoft JMRP with attached original).
  2. { "raw": "<raw report email>" } as application/json.
  3. Structured JSON payloads from upstream providers ({ recipient, emailId, messageId, feedbackType, source }).
Forward a raw ARF/JMRP complaint report
SIG=$(openssl dgst -sha256 -hmac "$FBL_WEBHOOK_SECRET" -hex < report.eml | awk '{print $NF}')
curl -X POST https://mail.example.com/api/v1/deliverability/fbl \
  -H "content-type: message/rfc822" \
  -H "x-mtakit-signature: sha256=$SIG" \
  --data-binary @report.eml

Abuse complaints mark the original message complained, record an event, and automatically add the recipient to your suppression list with reason spam_complaint. Reports of type not-spam and auth-failure are acknowledged without suppressing.

GET/api/v1/deliverability/complaintsRequires emails:read

Returns recent complaints and your 30-day complaint rate alongside Gmail and Yahoo warning (0.1%) and rejection (0.3%) thresholds.

Automated IP warm-up

Fresh own_mta or custom_smtp IPs build sender reputation using a geometric daily recipient cap that expands automatically:

PresetStart / dayDaily growthDays to 10,000 / day
conservative5020%31
standard5035%19
aggressive10060%11

Execution guarantees

  • Atomic SQL budget reservation: Parallel workers claim daily warm-up quota in a single SQL statement so concurrent traffic never overshoots today's limit.
  • Automatic failover overflow: Once the warming route exhausts today's budget, excess mail overflows via your failover chain (AWS SES, Postmark, Resend) and logs warmup_overflow. If no fallback exists, mail still delivers (warmup_over_cap) and fails open on errors.
  • 24-hour health guard: Over the last 24 hours (min. 100 recipients), a bounce rate ≥ 5% or complaint rate ≥ 0.1% halves the cap; ≥ 10% bounce or ≥ 0.3% complaint stops the warming route until metrics recover.
GET/api/v1/deliverability/warmupRequires providers:read
POST/api/v1/deliverability/warmupRequires providers:manage
Body parameters
providerIdstringrequired
UUID of the own_mta or custom_smtp route.
presetstringrequired
conservative, standard, or aggressive.
targetDailyVolumeintegerrequired
Target daily recipients where the warm-up plan completes and stops capping.
curl -X POST https://mail.example.com/api/v1/deliverability/warmup \
  -H "Authorization: Bearer $MTAKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "providerId": "b1b6f0de-2f55-4f6c-8d0a-5d1c1d7f6a20",
    "preset": "standard",
    "targetDailyVolume": 50000
  }'
PATCH/api/v1/deliverability/warmup/{id}Requires providers:manage
DELETE/api/v1/deliverability/warmup/{id}Requires providers:manage
Response
{
  "ok": true,
  "status": "paused"
}

Environment variables

VariablePurposeDefault
FBL_WEBHOOK_SECRETHMAC key for FBL intakeINBOUND_WEBHOOK_SECRET
MTAKIT_SPAM_CHECK_MODEoff, report or enforcereport
MTAKIT_SPAM_BLOCK_SCOREScore threshold blocking sends in enforce mode5
MTAKIT_SPF_HOSTSPF include host verified by the DNS auditnone