DNS records drift.
A provider changes a DKIM selector. A marketing team adds a new ESP. Someone edits a TXT record and accidentally removes the reporting address.
You do not need a full email platform to catch this. A daily CI job and a small API call are enough.
What to monitor
At minimum:
- SPF record exists
- DKIM selector still resolves
- DMARC record exists
- DMARC policy has not changed unexpectedly
- reporting address is still present
The goal is not to fail every time a record changes. The goal is to make changes visible.
A daily GitHub Action
name: email-auth-drift
on:
schedule:
- cron: "17 6 * * *"
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Scan domain
run: |
curl -s https://api.mailers.email/v1/scan \
-H 'content-type: application/json' \
-d '{"domain":"example.com"}' > scan.json
cat scan.json
- name: Check DMARC policy
run: |
jq -e '.dmarc.policy == "reject"' scan.json
Adjust the jq path to match the response shape you receive. The important part is that the job fails when a policy changes.
Do not run it on every commit
The public API is limited to 60 requests per hour per IP and caches each domain for 24 hours. A daily schedule is appropriate. A per-commit trigger is not.
For a larger domain portfolio, batch the checks and run them on a schedule rather than in the pull-request path.
Alert on changes, not just failures
A useful drift check records the previous result and compares it.
- policy changed from
quarantinetonone - DKIM selector disappeared
- SPF record changed
- reporting address removed
A simple JSON snapshot in the repository is enough to start.
Why this belongs in CI
Email authentication is infrastructure. If it breaks, password resets and invoices break.
Put it next to uptime checks, dependency checks, and DNS checks. It is cheap and it catches the kind of change that is invisible in code review.
API docs: https://mailers.email/api/scan/
Top comments (0)