Email security analysis
This topic is the single home for reading a domain’s mail posture: SPF, DMARC, DKIM, MX and how they combine. Other guides point here.
Email authentication relies on three DNS-based mechanisms:
- SPF - authorized sending IPs
- DKIM - cryptographic message signing
- DMARC - policy enforcement and reporting
Where the data comes from
Two tools answer mail questions:
| Tool | What it gives |
|---|---|
datapulse_live_dns(domain="example.com") | The raw records: MX, TXT (SPF is a TXT record starting v=spf1) and a dmarc field holding the _dmarc.<domain> TXT lookup, in one call |
datapulse_live_domain_health(domain="example.com") | An evaluated mail section: SPF lookup and void-lookup counts and the final all qualifier, DMARC policy and tags, MX targets checked for addresses, DKIM keys at a probed set of selectors, MTA-STS and TLS-RPT, each with findings |
Field-by-field detail for the health report’s mail section is in
datapulse_help(topic="domain_health_fields"). The live_dns response shape is in
datapulse_help(topic="dns").
The default live_dns lookup includes MX, TXT and the _dmarc TXT record (the full list and
what the summary strips: “Default lookup” in datapulse_help(topic="dns")).
SPF
A TXT record starting with v=spf1:
v=spf1 include:_spf.google.com ~all
| Qualifier | Meaning |
|---|---|
+all | Pass all (defeats SPF) |
-all | Hard fail unauthorized senders |
~all | Soft fail (mark but accept) |
?all | Neutral (no policy) |
SPF allows at most 10 DNS-querying terms (include, a, mx, ptr, exists, redirect);
the health report counts them in mail.spf.lookups and evaluates the qualifier the record
really ends with, following redirect=.
Suspicious IP literals in SPF
include: and the final qualifier are not the whole record: ip4: and ip6: mechanisms can
authorise unusual address space. Non-public space in SPF is potentially hostile or, at
minimum, a misconfiguration; published SPF normally references globally routable sending
infrastructure. The ones worth naming:
- IPv4 RFC 1918 private ranges in
ip4::10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 - IPv6 ULA space in
ip6::fc00::/7, includingfd00::/8 - Other non-routable or special-use space: loopback, link-local, unspecified
- Malformed or impossible literals and prefix lengths
v=spf1 ip4:10.0.0.0/8 -all
v=spf1 ip6:fd00::/8 include:_spf.example.net ~all
v=spf1 ip4:300.1.2.3 -all
v=spf1 ip6:fd00::/129 -all
An SPF finding is most useful when it names the exact mechanism and why it is unusual:
“ip4:10.0.0.0/8 is RFC 1918 private space and should not appear as public sending
infrastructure in SPF.”
DMARC
The dmarc field of a default live_dns response holds the _dmarc.<domain> TXT lookup.
Its status is one of:
status | Meaning |
|---|---|
found | record holds the full DMARC value |
none | The lookup answered and there is no DMARC record (NXDOMAIN, or no v=DMARC1 TXT) |
unknown | The lookup itself failed (SERVFAIL, REFUSED), so whether a record exists was not determined |
unknown is not none: a failed lookup is not evidence that the domain publishes no policy.
Subdomains inherit. The lookup is _dmarc.<exact name> only. For a name below its
registrable domain (www.osu.edu, mail.example.co.uk), a receiver that finds no record there
falls back to the organizational domain’s record (RFC 7489 §6.6.3) and applies its sp= policy,
or its p= when there is no sp=. So status: none on a subdomain does not mean the name is
unprotected: www.osu.edu has no record of its own and is covered by osu.edu’s sp=reject.
A subdomain is graded on the registrable domain’s record (datapulse_live_dns(domain="osu.edu"))
when it has none of its own.
v=DMARC1; p=reject; sp=reject; rua=mailto:dmarc@example.com
| Policy | Meaning |
|---|---|
p=none | Monitor only (no enforcement) |
p=quarantine | Mark as spam |
p=reject | Reject unauthorized mail |
| Tag | Purpose |
|---|---|
p | Policy for the domain |
sp | Policy for subdomains |
rua | Aggregate report destination |
ruf | Forensic report destination |
pct | Percentage of mail the policy applies to |
DKIM
DKIM keys live at <selector>._domainkey.<domain>, and selectors are arbitrary strings chosen
by the domain owner. They cannot be enumerated. The health report probes a fixed set of
common selectors (mail.dkim.selectors_probed) and reports the keys it found; a single
selector can be checked directly:
datapulse_live_dns(domain="google._domainkey.example.com", record_type="TXT") # Google Workspace
datapulse_live_dns(domain="selector1._domainkey.example.com", record_type="TXT") # Microsoft 365
An empty selectors_found means none of the probed names answered, not that the domain lacks
DKIM: google.com signs with dated selectors (20251104) that no fixed list guesses.
An undetermined DKIM status is an absence of evidence, not adverse evidence.
v=DKIM1; k=rsa; p=MIIBIjANBgkq...
MX and mail posture
An MX record is a claim, not a credential
Anyone may publish an MX pointing at any host, including a major provider’s, without that provider having provisioned anything. A recognisable platform hostname is not evidence that the platform accepts mail for the domain.
Hosted platforms derive the inbound hostname from the tenant’s own domain. For Exchange
Online, a correctly provisioned record for example.com reads
example-com.mail.protection.outlook.com: the domain’s own label with dots replaced by
hyphens. An MX that names a different organisation’s tenant hostname is a record that was
copied rather than provisioned, and the platform disowns it at delivery time:
550 5.7.64 TenantAttribution; Relay Access Denied
Such a record is decorative: it survives any check that performs the MX lookup and stops there. Reading the MX hostname against the domain publishing it comes before any conclusion about the platform it names. Matching an MX suffix identifies the platform, never the account holder.
Inbound and outbound are separate questions
A broken inbound path does not narrow the outbound one. With no SPF and no DMARC, nothing prevents a third party sending mail as the domain, whether or not it can receive any. SPF and DMARC stand on their own; the presence or absence of an MX says nothing about them.
MX and SPF need not name the same hosts: MX controls inbound routing, SPF authorises outbound senders, and a domain that receives on one platform and sends through another is ordinary.
No MX can be the correct posture
A domain not intended to receive mail commonly publishes no MX at all while publishing a
restrictive SPF (-all) and p=reject DMARC. That refuses inbound structurally and strongly
protects against successful spoofing at DMARC-enforcing receivers: a forged message can still
be transmitted, but compliant receivers reject or quarantine it.
| Brand-shaped MX, no SPF, no DMARC | No MX, -all SPF, p=reject DMARC | |
|---|---|---|
| Can receive mail | No (the tenant disowns it) | No (no MX published) |
| Can be spoofed outbound | Yes | No, at enforcing receivers |
| Reading | Decorative record, unprotected | Deliberate, defensible |
The configuration with the more brand-shaped mail record is the weaker one. MX absence is not a gap until SPF and DMARC are read alongside it.
Assessment matrix
| Check | Good | Weak | Bad |
|---|---|---|---|
| SPF | -all | ~all | +all, missing, or non-public ip4:/ip6: literals |
| DMARC | p=reject (a subdomain: its own p=, else the registrable domain’s sp=/p=) | p=quarantine | p=none on a production domain, or no record at the name and, for a subdomain, none at its registrable domain |
| DKIM | Valid key found | - | Not determinable from probed selectors: not a finding |
| MX | Absent on a non-mail domain, or naming the domain’s own tenant | - | Names another organisation’s mail tenant |
A DMARC status of unknown is a gap in the check, not a “missing” row. A subdomain’s
status: none is graded on the registrable domain’s record, as described under DMARC above.
Very short DKIM keys (RSA under 1024 bits) fail; under 2048 bits is recorded as information.
Example workflow
# 1. Evaluated posture: SPF, DMARC, MX, DKIM at probed selectors, MTA-STS, TLS-RPT
datapulse_live_domain_health(domain="example.com")
# 2. The raw records, when a value needs quoting
datapulse_live_dns(domain="example.com")
# 3. A specific DKIM selector the domain is known to use
datapulse_live_dns(domain="s1._domainkey.example.com", record_type="TXT")
# 4. Has the mail provider changed? The history records MX hostnames and their ASNs over time
datapulse_dns_dphistory(domain="example.com")
The history (datapulse_help(topic="history")) holds MX, nameserver and web-hosting providers,
not TXT records: it dates a change of mail provider, not a change of SPF or DMARC.
Related topics
datapulse_help(topic="lookalike_domains")- brand-carrying and misspelled domains, where mail posture is part of the triagedatapulse_help(topic="domain_health_fields")- every field of the health report’smailsectiondatapulse_help(topic="dns")- thelive_dnsresponse, including thedmarcfield
Generated from the live server (DataPulse MCP v0.9-341-g27163c2) on October 20, 2026. Your AI assistant reads this page by calling datapulse_help(topic="email_security").