SPF fail: "domain does not designate IP as permitted sender"

The server that sent the message is not in the domain's SPF record. How to find the missing service and add it.

In message headers:

Received-SPF: softfail (google.com: domain of transitioning jan@example.com
does not designate 198.51.100.7 as permitted sender)

Received-SPF: fail (google.com: domain of jan@example.com does not designate
198.51.100.7 as permitted sender)

Or as a rejection from Microsoft 365:

550 5.7.23 The message was rejected because of Sender Policy Framework violation

The server with that IP address sent the message, and it isn't in the SPF record of the envelope sender's domain. softfail means the record ends in ~all; fail means -all. "Transitioning" is just Gmail's wording for softfail.

How to fix it

  1. Identify the server. Look up who owns the IP address:
    dig -x 198.51.100.7 +short
    The name often gives it away (for example mail-sor-f41.google.com, or a hosting company).
  2. Is it yours? If it's a service you use, add it to your SPF record: the provider's include:, or ip4: for your own server. See how to set up SPF.
  3. Is it a forwarder? If the message went through a forwarding address or a mailing list, SPF failing is expected. See forwarding. DKIM should carry the message through.
  4. Is it unknown? Then someone else is using your domain, and SPF is doing its job. See spoofing.

One SPF failure is not the end of the story: DMARC passes if DKIM passes and aligns. Make sure every service you use signs with DKIM for your domain, so a gap in SPF doesn't take your mail down.