Why do your emails hit spam? Check the headers you never look at — offline .eml audit
If you send transactional email — receipts, password resets, magic links — deliverability isn't a marketing problem, it's an engineering one. And the diagnostic data is sitting in the headers of every message you've ever
If you send transactional email — receipts, password resets, magic links — deliverability isn't a marketing problem, it's an engineering one. And the diagnostic data is sitting in the headers of every message you've ever received. Nobody looks at it.
I built a tool that reads any .eml file and produces a deliverability report, fully offline.
What email_audit.py checks
Drop in a received email (or raw headers) and it reports:
-
AUTH: parses
Authentication-Resultsfor SPF/DKIM/DMARC verdicts — fails and absent mechanisms are findings -
HOPS: counts
Receivedheaders — a long chain means your mail is being relayed through infrastructure you don't control -
RISK: missing
List-Unsubscribe/ bulkPrecedence,X-Mailerleaks (hand-rolled scripts announcing themselves), HTML-only body, malformedDate, missingMessage-ID - META: From/To/Subject/Date + Return-Path-vs-From domain mismatch
python3 tools/email_audit.py message.eml # human report
python3 tools/email_audit.py message.eml --json # pipeline
python3 tools/email_audit.py message.eml --strict # any finding = exit 1
Verified against paired fixtures
examples/good.eml (pass auth, list-unsubscribe, bulk precedence) → clean, exit 0. examples/bad.eml (spf/dkim/dmarc fail, no unsubscribe, HTML-only, bad date, X-Mailer leak, Return-Path domain mismatch) → 9 findings, exit 1.
The honest limits
- It reads headers as received — trusting the receiver's
Authentication-Resultsrather than recomputing DNS itself (adig-based companion is the right next tool, not this one). - It doesn't predict spam-folder placement — that's reputation, which lives at the receiver. This is a header-hygiene audit.
- SRS/rewrite edge cases in Return-Path are noted but not penalized.
$10, stdlib only, works on any .eml you have:
https://wesleygitari2-cloud.github.io/nexus-store-redirect/p/email-header-audit
Last time an email of yours hit spam — did you check headers, or just resend?
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.