Tempboxy
Email Tools · 7 min read

Reading email headers, MX, SPF, DKIM & DMARC.

Practical developer guide to reading raw SMTP Received headers, tracing mail delays, checking live MX records, and verifying SPF, DKIM & DMARC.

Reading SMTP Received hops bottom-to-top

Every mail transfer agent (MTA) that touches an email prepends a new Received: line to the top of the message header. Because each relay adds its stamp on top, the chronological journey of an email always reads from bottom to top: the lowest Received header is the sending origin, and the topmost header is the recipient's final mail server.

Comparing consecutive timestamps across hops immediately exposes where an OTP or password-reset email got stuck. If hop #1 to hop #2 took 1 second, while hop #2 to hop #3 took 45 seconds, the bottleneck lives at the intermediate relay or greylisting filter — not in your application code. You can paste raw headers directly into our browser-local Email Header Analyzer to calculate hop-by-hop delays automatically.

SPF, DKIM, and DMARC in plain English

Modern inbox providers (Google Workspace, Microsoft 365, Apple iCloud) inspect three DNS-backed authentication controls inside the Authentication-Results header before deciding whether to inbox, quarantine, or reject a message:

ProtocolDNS Record LocationWhat It Verifies
SPFTXT @ domain.comWhether the connecting sending IP is authorized by the domain's v=spf1 policy.
DKIMTXT selector._domainkeyCryptographic RSA/Ed25519 signature proving headers and body were not altered in transit.
DMARCTXT _dmarc.domain.comDomain alignment between From: and SPF/DKIM, plus reject/quarantine instructions on failure.

How DNS MX records route incoming mail

Before an outbound mail server sends a single byte of SMTP traffic, it queries DNS for the recipient domain's MX (Mail Exchange) records. Each MX entry specifies a target mail host and a numeric priority where lower numbers have higher preference (for instance, priority 1 is tried before priority 5 or 10).

If a domain has zero MX records and no fallback A/AAAA mail listener, emails sent to that domain will permanently bounce. Running a live check in our Email Domain MX Checker queries real DNS records in real time and identifies the underlying provider (Google Workspace, Microsoft 365, Proton Mail, Cloudflare Email Routing, Zoho, or self-hosted MX) alongside live SPF and DMARC TXT records.

Validating email syntax and MX deliverability

Catching malformed or undeliverable addresses at form submission saves bounce reputation. A complete pre-send check combines three layers available in our Email Address Validator and RFC 5322 Format Validator:

  1. RFC 5322 syntax verification: Checks total length (≤ 254 characters), local-part bounds (≤ 64 characters), consecutive or edge dots, valid hostname labels, and support for +tag sub-addressing.
  2. Typo & disposable awareness: Catches common user typos (gamil.com, hotnail.com, outlok.com) and checks domains against our Disposable Email Domain Checker.
  3. Live MX resolution: Confirms the domain actually publishes mail exchange servers capable of receiving SMTP mail.

A 60-second deliverability debug checklist

Whenever verification emails stop landing in user inboxes, walk through these four checks in order:

  1. Run your sending domain through the MX / SPF / DMARC Checker to verify valid TXT policies.
  2. Send a real test message to a fresh Tempboxy testing inbox and inspect the extracted OTP, HTML preview, and tracker score.
  3. Export the message as .eml or copy raw SMTP headers into the Email Header Analyzer to confirm spf=pass, dkim=pass, and dmarc=pass.
  4. Run the subject and HTML body through the Spam Score Audit to catch missing plain-text fallbacks or unintended tracking pixels.

Key Takeaway

Raw email headers record every mail server hop from origin to recipient in reverse chronological order, alongside cryptographic authentication verdicts (SPF, DKIM, and DMARC). Pairing header inspection with live DNS MX and TXT lookups reveals whether slow delivery or spam placement is caused by relay latency, missing SPF/DMARC records, or Return-Path misalignment.

Continue reading

Related engineering guides

Questions

Frequently asked

Does the Tempboxy MX Checker perform real live DNS lookups?

Yes. /api/tools/dns-mx runs live Node DNS queries (resolveMx and resolveTxt) directly against public DNS resolvers for MX, SPF, and _dmarc records.

Are pasted SMTP headers uploaded to a server?

No. The Email Header Analyzer parses Received hops, timestamps, and Authentication-Results entirely inside your browser.

Why do lower MX priority numbers take precedence?

By RFC 5321 convention, preference values rank mail exchangers from most preferred (lowest integer, e.g., 1 or 10) to backup fallback servers (higher integers, e.g., 20 or 50).

Need more answers? Browse all 29 topics in the Complete Tempboxy FAQ.