Business email that reaches the inbox: SPF, DKIM and DMARC in plain words
When a quote, an invoice or an order confirmation from your business lands in a customer's spam folder, the customer usually assumes you never sent it. Often the cause is not the message at all, but three short records in your domain's DNS settings that tell the world which servers may send mail for your domain. Large mailbox providers now expect them, and an attacker without them can send mail that looks like it came from you.
This guide explains what SPF, DKIM and DMARC each do, the order to set them up, and how to check them without cutting off your own mail.
Why this matters now
Gmail's published sender guidelines ask every sender to authenticate its mail with SPF or DKIM, and senders of more than about 5,000 messages a day to personal Gmail addresses must have SPF, DKIM and a DMARC record, with the visible From address aligned with one of them. Other large providers have similar rules. Even if your business sends far less, the same checks decide where your mail lands, and a domain with no DMARC record is easier for scammers to impersonate in messages to your customers.
First, list everything that sends mail as you
Before you change any record, write down every service that sends email using your domain in the From address. A typical small business has more than it thinks:
- the mailbox provider your staff use every day;
- the website or online store, for order confirmations and contact form replies;
- an email marketing or newsletter service;
- invoicing, booking, help desk or payment services that send receipts in your name.
Every one of these must be covered by the records below, or its mail will start failing the checks once you tighten them.
1. SPF: the list of allowed senders
SPF (Sender Policy Framework) is one text record on your domain that lists the servers allowed to send mail for it. Each email service tells you what to add, usually an include: for its servers. A finished record might look like:
v=spf1 include:_spf.your-mail-provider.example include:mail.your-store.example ~all
Three rules keep SPF working. Keep exactly one SPF record per domain; two records make both invalid. Stay under the limit of ten DNS lookups that SPF allows, because each include: can count several, and a record over the limit fails. End with ~all (soft fail) while you are testing, and move to -all only once you are sure the list is complete.
2. DKIM: a signature on every message
DKIM (DomainKeys Identified Mail) adds a digital signature to each message. The sending service keeps a private key, and you publish the matching public key in your DNS, usually as a record with a name such as selector._domainkey.yourdomain. A receiving server checks the signature and knows the message really came from an approved sender and was not changed on the way. Each sending service has its own DKIM setup page; turn it on for every service on your list, not only your main mailbox.
3. DMARC: the rule and the report
DMARC ties the two together. It tells receiving servers what to do when a message claims to be from your domain but fails both SPF and DKIM alignment, and asks them to send you reports. Start with a record that only watches:
v=DMARC1; p=none; rua=mailto:[email protected]
It goes in a text record named _dmarc.yourdomain. With p=none, nothing is blocked; you simply start receiving daily summary reports that show every server sending mail as your domain and whether it passed. Use a dedicated address for the reports, because they arrive as machine-readable files, and a free or paid report reader makes them much easier to follow.
4. Tighten slowly
Read the reports for a few weeks. Each legitimate service that fails needs its SPF include or its DKIM switched on. Anything you do not recognise is either a service you forgot or someone pretending to be you. When the legitimate mail passes consistently, move the policy to p=quarantine, which sends failing mail to spam, and later to p=reject, which refuses it. You can also roll out gradually with the pct= setting, applying the policy to a share of failing mail at first.
How to check your setup
- Send a test message from each service on your list to a personal mailbox, open it, and look at the message details or original headers. They show whether SPF, DKIM and DMARC passed.
- Look up the records with a free DNS lookup tool to make sure there is one SPF record, a DKIM record for each service and one DMARC record.
- Watch the DMARC reports after every change, and whenever you add a new tool that sends mail.
Mistakes we see most
- Two SPF records, often after a second service was added by pasting a new record instead of editing the old one.
- Forgetting the website or store, so order confirmations fail while staff mail works.
- Jumping straight to
p=rejectand silently blocking invoices sent by a service nobody listed. - Never reading the reports, which leaves DMARC as a record that protects nothing.
- Leaving an old service in SPF after you stop using it, which lets that service's other customers pass as you.
The short version
List every service that sends mail as your domain. Publish one SPF record that names them, switch on DKIM in each one, and add a DMARC record that starts at p=none with a report address. Read the reports, fix every legitimate sender that fails, then tighten the policy to quarantine and finally reject. Check again whenever you add a new tool that sends mail for you.