---
title: "SPF Syntax; Mechanisms, Qualifiers, and Modifiers | AutoSPF"
description: "SPF syntax has three elements- SPF Mechanisms, SPF Qualifiers, and SPF Modifiers. Together they instruct recipients’ mail servers how to handle emails comi"
image: "https://autospf.com/images/og-default.png"
canonical: "https://autospf.com/spf-validator/spf-syntax/"
---

#  SPF Syntax; Mechanisms, Qualifiers, and Modifiers 

## Try Our Free SPF Checker

Instantly analyze any domain's SPF record - check syntax, count DNS lookups, and flag errors.

[ Check SPF Record →](/tools/spf-checker/) 

![Spf Records 300x300](https://media.mailhop.org/autospf/images/2023/10/spf-records-300x300.jpg) 

**SPF syntax** has three elements- SPF Mechanisms, SPF Qualifiers, and SPF Modifiers. Together they instruct recipients’ mail servers how to handle emails coming from your domain, define their scope, and prevent [phishing](https://www.wired.com/story/qr-codes-phishing-attack/) and spoofing attacks. 

They contain information about which [IP addresses](https://www.kaspersky.com/resource-center/definitions/what-is-an-ip-address) (belonging to ip4-network and ip6-network ranges) or mail server groups are **authorized to send emails** on behalf of your organization.

Note that it’s recommended to use SPF in conjunction with DKIM and DMARC for the **best delivery rate** and protection from phishing.

![Spf Record Check 1](https://media.mailhop.org/autospf/images/2023/11/spf-record-check-1.jpg) 

## SPF Mechanisms

The [SPF syntax](/spf-validator/) Mechanisms define the set of hosts that are considered designated mailers for the domain or subdomain. These are prefixed with one of the four **SPF Qualifiers** mentioned in the next section of this guide.

### 1\. ALL

It’s used at the **end of an SPF TXT record** and instructs mail receivers’ servers about how they should deal with emails coming from your domain but failing SPF checks.

### 2\. A

It indicates a domain name with an A or [AAAA address record](https://support.dnsimple.com/articles/aaaa-record/) as a match and directs to the sender’s address.

### 3\. Ip4

This SPF Mechanism tells that IP addresses listed in the [SPF record](/spf-validator/what-does-an-spf-generator-do-for-you/) belong to the ip4 network range. You have to use it with a prefix, and **/32 is the default one**. 

### 4\. Ip6

This **SPF Mechanism** tells that the IP addresses in the SPF record belong to the [ip6 network range](https://www.redhat.com/sysadmin/what-you-need-know-about-ipv6). In the case of no prefix-length, /128 is used by default. 

### 5\. MX

An MX Mechanism tag lets senders use the same IP address as the one added to the specified MX record. All the A records used for MX records are evaluated in the order of MX priority. 

When an MX record belonging to a domain includes an IP address the same as the sender’s IP address, the sender is allowed to send emails using that domain name.

### 6\. PTR

The PTR tag helps in looking for hostnames for client IPs. It’s mandatory for at least one of the **A records** to match the original client IP for a successful [hostname validation](https://wiki.openssl.org/index.php/Hostname%5Fvalidation). All invalid hostnames are discarded. 

The use of the PTR Mechanism is not recommended as it’s slow, unreliable, and also causes more [SPF](/spf-validator/does-spf-all-make-your-domain-less-secure/) DNS lookups that can result in a Permerror. 

### 7\. EXISTS

The _Exists_ **SPF record syntax** does a DNS A record search for the domain provided. _A successful match is achieved only if a valid A record is located and that’s independent of the lookup limit._

### 8\. INCLUDE

The _Include_ **SPF record syntax** lets you add ipv4 or ipv6 IP addresses of vendors who send emails on behalf of your organization or its sources. These are usually outsourced marketing or PR agencies. [Sender authorization](https://www.livingsecurity.com/support/what-is-sender-authentication) happens when its IP address is the same as the IP address or domain added to the SPF record. You’ll come across an SPF Permerror if you don’t add their IP address, and yet they send emails on your behalf. 

![Spf Record Tester 3](https://media.mailhop.org/autospf/images/2023/11/spf-record-tester-3.jpg) 

[Image sourced](https://caniphish.com/phishing-resources/blog/australian-spf-scan) from [www.caniphish.com](http://www.caniphish.com)

## SPF Qualifiers

Each Mechanism can be grouped with one of the **four SPF Qualifiers**. 

**Qualifier**

**Result**

**Instructions for The Recipient’s Server**

Pass

It’s not recommended to use this SPF Qualifier as it allows anyone on the internet to send emails on your behalf. **It’s the default action** taken when there’s no SPF Qualifier in an SPF record.

–

Fail

In this case, the email message hasn’t come from a legitimate source, due to which it will get rejected by the recipient’s mailbox. 

\~

Softfail

The recipient’s server accepts the message failing SPF authentication checks, but it [lands in the spam folder](https://www.courthousenews.com/judge-tosses-rncs-lawsuit-against-google-over-emails-sent-to-spam-folders/).

?

Neutral

In this case, the email neither passes nor fails authentication checks since the SPF record doesn’t explicitly state whether the sender is authorized to send messages. Its use is highly discouraged.

## SPF Modifiers

The last leg of **SPF syntax** includes SPF Modifiers that are name or value pairs separated by **an = symbol**. They appear at the end of SPF records and represent additional information. _Also, your SPF DNS record will show errors if a Modifier is used multiple times and all the unrecognized SPF Modifiers are ignored._ 

### redirect Modifier

It points to other SPF records for processing and is used when you have to use the same SPF content over [multiple SPF records](https://www.courier.com/guides/multiple-spf-records/) generated for other domain names.

It’s used only when you control other domains as well; otherwise, an _include_ Mechanism is used.

### exp Modifier

You use it in an SPF record to provide an explanation in case of a – (fail) Qualifier is present on a Mechanism that is matched.

![Spf Record Tester](https://media.mailhop.org/autospf/images/2023/11/spf-record-tester.jpg) 

## An SPF Record Generator Gets the Job Done in No Time

Not properly learning about **SPF syntaxes** and generating an SPF record manually can lead to an **SPF Temperror** or other [configuration issues](https://www.theregister.com/2023/08/21/microsoft%5Fdns%5Fbooboo%5Fbreaks%5Fhotmail/), especially if you are new at it. Instead, use an online automatic SPF record generating tool that produces a record from scratch, leaves no-to-minimum scope of problems, ensures a high deliverability rate, and offers **protection from spoofers**.

## Fix your SPF record in 60 seconds

page.data.title toolBanner && toolBanner.label toolBanner.description toolBanner.cta → showCTA && g2Config &&

[Start Free Trial→](/pricing/)

```json
{"@context":"https://schema.org","@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]},"sameAs":["https://www.wikidata.org/wiki/Q138897474","https://www.linkedin.com/company/autospf","https://x.com/autospf01","https://www.facebook.com/autospf","https://github.com/duocircle","https://www.g2.com/products/autospf/reviews"],"aggregateRating":{"@type":"AggregateRating","ratingValue":"5.0","reviewCount":"21","bestRating":"5","worstRating":"1","url":"https://www.g2.com/products/autospf/reviews"},"contactPoint":{"@type":"ContactPoint","contactType":"customer support","url":"https://autospf.com/contact-us/"},"knowsAbout":["SPF Record Flattening","Sender Policy Framework","Email Authentication","DNS Management","DMARC","DKIM","Email Deliverability","SPF Lookup Limits"]}
```

```json
{"@context":"https://schema.org","@type":"WebSite","name":"AutoSPF","url":"https://autospf.com","description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","publisher":{"@type":"Organization","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]}}}
```

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://autospf.com/"},{"@type":"ListItem","position":2,"name":"Spf Validator","item":"https://autospf.com/spf-validator/"},{"@type":"ListItem","position":3,"name":"Spf Syntax","item":"https://autospf.com/spf-validator/spf-syntax/"}]}
```
