Outbound Wiki

SPF records

How Sender Policy Framework records authorize the mail servers that can send email for a domain.

SPF setup starts with an inventory of who sends mail for the domain and ends with that inventory published in DNS. SPF's primary purpose is to validate email sources for a domain.1 Receiving systems inspect the sender address used during SMTP transmission, called the MAIL FROM address.2 Start by identifying the domain each sending system uses for its envelope sender, then build the inventory before editing DNS. Turn it into the record and test the result from a receiving system's perspective.

How to run the setup

Use this order to work through the setup. Each stage answers a different question before the next step.

Stage What you are trying to learn Example question
Inspect the domain's current authorization state Is there already an SPF record?
Inventory every system that sends mail Which systems send for this domain?
Assemble the complete authorization line What value represents each sending source?
Publish who controls the DNS change Where should the record be entered?
Verify what a receiving system sees Does the sending source pass?
Diagnose why a check failed Is the result missing, temporary, or permanent?

Check the current state

First check whether SPF work is needed and whether a record already exists. This prevents changes to a record managed elsewhere.

If you use only the Microsoft Online Email Routing Address domain, known as MOERA, for email, you do not need to take action because its SPF TXT record is already configured.34 For other domains, use a free tool on the internet to check whether SPF is already set up.5 You also do not need to set up SPF when the domain already has it configured by default or was bought from a Google partner during Google Workspace signup.6

Inventory the sending systems

Build the source list from actual mail flow. Include ordinary mail systems and services that send on the domain's behalf.

Record every IP address or address range from which email is sent.7 Add the hostnames permitted to send from the domain.8 Include both IPv4 and IPv6 sources when they are part of the sending setup.9 Use the MAIL FROM domain as the domain you are authorizing.10

Keep this list with the team that manages email and DNS. Every sending system should have a source that can be represented in the record.

Assemble the record

Turn the inventory into one authorization line. Follow the provider's instructions for the syntax instead of creating a value from memory.

SPF uses a TXT record in DNS to identify valid mail sources for the domain.11 The record is a line of text with special syntax that lists the servers sending email for the domain.12 SPF publishes the authorized sources as a single TXT record on the domain.13 Follow your domain provider's instructions when adding that line.14

If the sending service is Google, an example record is v=spf1 include:_spf.google.com ~all.15 Use it as a provider specific example and replace it only with values that match the systems in your inventory.

Mechanisms are evaluated in order. When a mechanism matches, its qualifier supplies the result; when nothing matches, the result is Neutral.16 Review the line from left to right before publishing it and confirm that every intended sender appears in the syntax.

Publish the DNS change

Enter the completed record where the domain's public DNS is managed. It should match the inventory you checked.

Create the SPF record in public DNS using all IP addresses or address ranges from which email is sent.7 For an email domain in Microsoft 365, create the DNS SPF TXT record for that domain and identify Microsoft 365 as an authorized mail source.17

After entering the record, check the published value rather than relying on what was pasted into the DNS editor. Confirm that it contains the intended sources and uses the expected syntax.

Verify the receiver's result

Check the published record against the source used by the message, then investigate the result returned by the receiving system.

Receiving servers check a domain's SPF record to verify that messages came from authorized servers.18 When the sending IP appears in the acceptable list, the receiving email service forwards the message to the recipient's inbox.19 When the service cannot confirm that the IP is valid, it marks the message according to the DMARC policy implemented for the sending domain.20

A domain with no SPF record produces None. A temporary DNS processing problem produces TempError, while a syntax or evaluation problem produces PermError.21 Use the result to add a missing source, fix the record syntax, or investigate the DNS problem. Correct SPF can also help prevent outgoing email from being marked as spam by receiving email servers.22

What not to do

These mistakes can create false confidence or cause valid mail to fail authentication.

  • Do not publish a second SPF record to add another sender. Only one SPF record works on a domain at a time.23
  • Do not use the dedicated SPF RR type 99. As of August 11, 2025, major email providers and DNS services no longer support it.24
  • Do not use a record type other than TXT for SPF.25
  • Do not choose authorized sources from the visible From field alone. SPF checks the sender address used during SMTP transmission, the MAIL FROM address.2
  • Do not assume forwarding preserves SPF verification. SPF verification fails when email is forwarded between mail servers.26
  • Do not leave downstream servers outside the configuration when they are part of the delivery path.27

For broader domain protection, set up DKIM and DMARC alongside SPF.28 Together, these protocols help protect the domain from spoofing and improve email deliverability.29

Tool for this

Sending from your own mailboxes, safely paced

Intedat covers the basics here properly. It sends from the Gmail, Microsoft 365 or SMTP mailbox you already own, shows SPF, DKIM and DMARC checks for a custom domain and rechecks them, and the daily limit per mailbox tops out at 100 inside a sending window you set per workflow. It will not warm a mailbox up for you, so that part stays your job.

Open Intedat

Sources

  1. 1
    “The primary purpose of SPF is to validate email sources for a domain.”
  2. 2
    “Receiving email systems use the SPF TXT record to verify that email from the sender address used during the SMTP transmission of the message (known as the MAIL FROM address, 5321.MailFrom address, P1 sender, or envelope sender) is from a known, designated source of mail for that domain.”
  3. 3
    “If you use only the Microsoft Online Email Routing Address (MOERA) domain for email (for example, contoso.onmicrosoft.com): You don't need to do anything.”
  4. 4
    “The SPF TXT record is already configured for you.”
  5. 5
    “To check if SPF is already set up for your domain, use one of many free tools available on the internet.”
  6. 6
    “You don't need to set up SPF if your domain already has SPF set up by default, or if you bought your domain from a Google partner when you signed up for Google Workspace.”
  7. 7
    “Create an SPF record in your public DNS, using all the IP addresses or address ranges from which you send email.”
  8. 8
    “The record contains a list of IP addresses and/or hostnames that are permitted to send email from your domain.”
  9. 9
    “You can use both IPv4 and IPv6 addresses.”
  10. 10
    “Identify valid sources of mail from the MAIL FROM domain.”
  11. 11
    “Specifically, SPF uses a TXT record in DNS to identify valid sources of mail for the domain.”
  12. 12
    “The line of text uses special syntax and lists all the servers that send email for your domain.”
  13. 13
    “SPF publishes a list of authorized sending sources as a single TXT record on your domain.”
  14. 14
    “An SPF record is a line of text that you add to your domain, following your domain provider's instructions.”
  15. 15
    “v=spf1 include:_spf.google.com ~all”
  16. 16
    “If a mechanism results in a hit, its qualifier value is used. The default qualifier is “+“, i.e. “Pass”. Mechanisms are evaluated in order. If no mechanism or modifier matches, the default result is “Neutral”.”
  17. 17
    “if your email domain in Microsoft 365 is contoso.com, you create an SPF TXT record in DNS for the contoso.com domain to identify Microsoft 365 as an authorized source of mail from contoso.com.”
  18. 18
    “When receiving servers get email messages from your domain, they check the SPF record to verify that the messages came from authorized servers.”
  19. 19
    “If the IP address appears in the list of acceptable IPs, the receiving email service will forward the email to the recipient's inbox.”
  20. 20
    “If the receiving email service cannot confirm the IP address is valid, then it marks the email in accordance with the DMARC policy you have implemented on the domain the email is being sent from.”
  21. 21
    “If a domain has no SPF record at all, the result is “None”. If a domain has a temporary error during DNS processing, you get the result “TempError” (called “error” in earlier drafts). If a syntax or evaluation error occurs (eg. the domain specifies an unrecognized mechanism) the result is “PermError” (formerly “unknown”).”
  22. 22
    “SPF helps prevent your outgoing email from being marked as spam by receiving email servers.”
  23. 23
    “Only one SPF record will work on your domain at a time”
  24. 24
    “As of August 11th, 2025, SPF records defined using the dedicated SPF RR (Resource Record type 99) are no longer supported by major email providers and DNS services.”
  25. 25
    “All SPF records must now be defined using the TXT record type.”
  26. 26
    “Furthermore, if emails are forwarded between mail servers, e.g., if you are using Salesforce, the SPF verification fails.”
  27. 27
    “It’s important to correctly configure your SPF with respect to your e-mail domains and any downstream servers.”
  28. 28
    “For comprehensive email security, you should also set up DKIM and DMARC.”
  29. 29
    “Together, these protocols help protect your domain from spoofing and improve email deliverability.”