Senderward

SPF fail in a DMARC report when the header says pass

Updated

You open a message from your own system, and the header says spf=pass. Then the DMARC report for the same day says SPF failed for that sender. Both are correct. The header and the report answer different questions, and often they are not even about the same delivery.

The report has two SPF results

Every record in an aggregate report mentions SPF twice:

<row>
  <source_ip>203.0.113.25</source_ip>
  <count>412</count>
  <policy_evaluated>
    <disposition>none</disposition>
    <dkim>pass</dkim>
    <spf>fail</spf>
  </policy_evaluated>
</row>
<identifiers>
  <header_from>example.com</header_from>
  <envelope_from>bounces.example.org</envelope_from>
</identifiers>
<auth_results>
  <spf><domain>bounces.example.org</domain><scope>mfrom</scope><result>pass</result></spf>
</auth_results>

The header on the message is the first of these. It looks like this:

Authentication-Results: mx.example.net;
  spf=pass smtp.mailfrom=bounces.example.org;
  dkim=pass header.d=example.com;
  dmarc=pass header.from=example.com

spf=pass there says only that SPF passed for the domain after smtp.mailfrom=. Many report tools show the policy_evaluated value in their "SPF" column, so the same mail reads "pass" in the header and "fail" in the tool.

Which case you have

Find the record for the sender in the report and compare envelope_from, header_from and the two results.

In the recordWhat it isWhat to do
auth_results SPF pass, envelope_from is another domain than header_fromSPF passed for the sending service's bounce domain. Not aligned.Nothing, if policy_evaluated/dkim is pass. See below.
auth_results SPF fail or softfail, envelope_from is your domain, source_ip is not one of yoursForwarding. The header you read was from the direct delivery, the record is a forwarded copy.Nothing. See Forwarding.
auth_results SPF pass, envelope_from is a subdomain of header_from, aspf is s in policy_publishedStrict alignment. A subdomain return-path only counts in relaxed mode.Decide whether you need aspf=s.
auth_results SPF domain is a server name, envelope_from is emptyA bounce or auto-reply with an empty return-path. SPF was checked against the server's HELO name.Nothing. These need DKIM to pass DMARC.

Result and alignment

DMARC only counts an SPF pass when the return-path domain matches the domain in From:. In relaxed mode, the default, a subdomain is enough: bounces.example.com matches example.com. In strict mode (aspf=s) the two must be identical.

Most email services use their own bounce domain as return-path unless you set up a custom one. SPF then passes for their domain, which says nothing about yours, and the report shows fail under policy_evaluated. Adding the service's include: to your SPF record does not change this, because your SPF record is not the one being checked.

How to make SPF align for a service, with the record to publish, is on Lookproof's page SPF passes but DMARC fails.

Forwarding

The header you looked at came from one message, delivered once. A report record adds up many deliveries, and some reach the reporting receiver through a forwarder: an old address that forwards to a new mailbox, a school or alumni alias, a shared address that fans out.

The forwarder keeps your return-path but connects from its own IP. That IP is not in your SPF record, so the SPF check itself fails, with your domain as envelope_from. These show up as separate records with small counts and source IPs you do not know. The record for your real sending IP, with the large count, still shows what the header showed.

You cannot fix SPF for forwarded mail, and should not try by widening your SPF record. A DKIM signature usually survives forwarding, and that is what carries DMARC for these messages. To tell forwarders from other unknown rows, see Why DMARC reports show sources you don’t recognise.

When the SPF fail matters

DMARC passes when either SPF or DKIM passes with alignment. So read the two policy_evaluated values together:

Comparing a header with a report

  1. Take the IP from the Received: or Received-SPF: header of the message and find the record with that source_ip, in the report from the receiver that added the header.
  2. Check that the report's date_range covers the day the message was received. The range is in UTC.
  3. Compare smtp.mailfrom in the header with envelope_from in the record. If they match, the header's SPF result is the one under auth_results.
  4. If no record has that IP, the record you were looking at is a different path for the same mail, usually a forwarder.

For every field in the report, see How to read DMARC aggregate reports.

Check your domain

Free DMARC check by Lookproof. Opens on lookproof.dev.

Senderward checks your domain's DMARC, SPF, DKIM, MX, MTA-STS and TLS-RPT every day and emails you, with the fix, when something gets worse. $7 per domain per month, 14 days free. See pricing

Sources