SPF, DKIM and DMARC: How to make sure business emails arrive
Published · 10 min read
Listen to the article · read by an AI voice
An invoice, an offer or a reply to a customer is only useful if it arrives. Receiving mail servers have learned not to trust a message just because it names a sender. Three DNS records of your domain, called SPF, DKIM and DMARC, are how you prove that a mail really comes from you.
The topic matters for every business with its own domain. Google and Yahoo have enforced rules for senders since February 2024. Without these records, your mail risks landing in the spam folder or being rejected. This article explains what each record does, what the large providers require, and how to introduce the records in an order that does not endanger your regular mail.
Why emails land in spam: a sender without proof
Imagine you send an invoice from info@your-company.ge. The receiving server sees only the claim: this mail is from your-company.ge. Anyone can write that address into the From: field, and that is exactly what fraudsters do. The receiver cannot verify the claim. It is like a letter with a company letterhead but no signature and no postmark.
A server that cannot verify a sender has to guess, and it guesses cautiously. The invoice goes to the spam folder or is refused. The three records answer three different questions:
- SPF: Did the mail come from a server that is allowed to send for this domain?
- DKIM: Was the mail signed by the domain and left unchanged on its way?
- DMARC: What should the receiver do if the checks fail, and where should it report back?
SPF: which servers may send for the domain
SPF (Sender Policy Framework) is a TXT record of your domain that starts with v=spf1. It lists the servers that may send mail for the domain. The receiver compares the server that delivered the mail with this list.
The SPF record of esn.ge reads exactly:
v=spf1 mx include:_spf.webhosting.systems include:_spf.protonmail.ch -all
The parts mean:
v=spf1marks the record as SPF.mxallows the servers named in the MX records of the domain, which are the servers that receive its mail.include:adds the allowed servers of another domain. Here there are two such entries.-allsays that all other servers fail the check.
There is one technical limit you should know. According to RFC 7208, section 4.6.4, the evaluation of an SPF policy may not exceed 10 terms that need a DNS lookup. The query for the SPF record itself does not count. The limit applies to the whole evaluation, so every include: and every mx uses up part of this budget. If you keep adding services, check the total after every change.
DKIM: the signature of every email
DKIM (DomainKeys Identified Mail) works like a seal. The sending server signs each mail with a private key that never leaves the server. It adds the signature in a DKIM-Signature header. That header names the signing domain (d=) and a selector (s=). The selector is a label that allows a domain to use several keys side by side.
The receiving server uses these two values to find the matching public key in the DNS. It reads a TXT record whose name is made of the selector, ._domainkey. and the domain, and checks the signature with it. If the check succeeds, the mail was signed by the domain and was not altered on the way.
The record has this form. The names are placeholders for illustration only, and the dots stand for the key:
mail._domainkey.your-company.ge TXT "v=DKIM1; k=rsa; p=…"
Here mail is an example selector, k=rsa names the key type and p= is followed by the public key. Your mail provider generates the key pair and tells you the record to publish.
Key length matters. Google states: “Sending to personal Gmail accounts requires a DKIM key of 1024 bits or longer.” If your mail provider created an older, shorter key, ask for a new one.
DMARC: what happens to mails without valid proof, and the reports about it
SPF and DKIM each deliver a result, but neither says what a receiver should do with a failure. DMARC adds that rule. It is a TXT record at _dmarc. in front of the domain, for example _dmarc.your-company.ge.
A mail passes DMARC when SPF or DKIM passes and the domain checked is aligned with the domain in the From: header. Alignment closes a gap: without it, a fraudster could pass SPF with their own domain while showing your address in the From: field. The tags aspf=r and adkim=r select relaxed alignment for SPF and DKIM.
The policy p= has three values:
p=noneonly collects reports. Failing mail is treated as before.p=quarantineasks receivers to treat failing mail as suspicious, for example by moving it to the spam folder.p=rejectasks receivers to refuse failing mail.
DMARC also sends reports back, and these are its practical benefit. The tag rua names where aggregate reports go. They show which servers sent mail in the name of your domain and how it fared. The tag ruf names where failure reports go, and fo=1 asks for such a report whenever any of the checks fails.
The specification has changed recently. The new DMARC specification, known in the community as DMARCbis, was published in May 2026 as three RFCs: RFC 9989 (the core protocol), RFC 9990 (aggregate reporting) and RFC 9991 (failure reporting). RFC 9989 was published on May 19, 2026 and obsoletes RFC 7489 from 2015 and the experimental RFC 9091. DMARC has moved from Informational status to a Proposed Standard on the IETF Standards Track. Records still start with v=DMARC1, so existing records keep working. One source notes that most production deployments need nothing immediate.
What Google and Yahoo require from senders
Google distinguishes two groups. For all senders who send mail to Gmail accounts, the requirements apply from February 1, 2024:
- Set up SPF or DKIM for the sending domains.
- Keep the spam rate reported in Postmaster Tools below 0.3%. The monitoring section of the same page advises staying below 0.10% and never reaching 0.30% or higher.
- Use a DKIM key of 1024 bits or longer when sending to personal Gmail accounts.
Senders who send more than 5,000 messages per day to Gmail accounts must meet a second, stricter set of requirements, also from February 1, 2024:
- Set up SPF and DKIM for the domain.
- Set up DMARC. Google says the policy “can be set to none”.
- For direct email, the domain in the From: header must be aligned with either the SPF domain or the DKIM domain. This is required to pass DMARC alignment.
- Marketing and subscribed messages must support one-click unsubscribe and show a clearly visible unsubscribe link in the body. One-click unsubscribe works with the headers
List-Unsubscribe-Post: List-Unsubscribe=One-ClickandList-Unsubscribe(RFC 2369, RFC 8058).
Yahoo started enforcing its sender requirements in February 2024. According to Yahoo, enforcement was rolled out gradually while it monitored compliance through the first half of the year. The minimum is: “Implement SPF or DKIM at a minimum.”
Most small businesses are far below 5,000 messages a day. Even so, a sensible aim is to set up all three records. SPF or DKIM is only the lowest bar, and DMARC gives you the reports that show what happens to your mail.
Introduce it step by step: from p=none over p=quarantine to p=reject
DMARC with a strict policy can block your own legitimate mail if a sender has been forgotten, for example the newsletter tool or the web form. That is why the policy is raised in steps:
p=none: Publish the record and collect reports. Read them and check which servers send in the name of your domain. Fix SPF and DKIM for every legitimate sender.p=quarantine: When the reports show only legitimate mail passing, ask receivers to treat failing mail as suspicious.p=reject: When quarantine causes no more surprises, ask receivers to refuse failing mail.
The DMARC record of esn.ge is at the middle step and reads exactly:
v=DMARC1;p=quarantine;sp=quarantine;pct=100;rua=mailto:dmarc@reports.epicsoft.email;ruf=mailto:dmarc@reports.epicsoft.email;ri=86400;aspf=r;adkim=r;fo=1;rf=afrf;
The tags are separated by semicolons without spaces. Each part means:
v=DMARC1marks the record as DMARC.p=quarantineis the policy for the domain, andsp=quarantineapplies the same policy to its subdomains.pct=100applies the policy to all mail.rua=mailto:…andruf=mailto:…send aggregate and failure reports to a reporting address under epicsoft.email.ri=86400(the reporting interval) andrf=afrf(the report format) come from the old specification.aspf=randadkim=rselect relaxed alignment.fo=1asks for a failure report when any check fails.
Three tags of this record, pct, ri and rf, are removed in RFC 9989. We list them only because the record still contains them; a new record does not need them.
RFC 9989 also changes the following:
- The tag
t(testing mode) replacespct. It knows only all (100%) or nothing (0%). - The tag
npsets the policy for subdomains that do not exist. If it is omitted, thesppolicy is used. - The tag
psd(public suffix domain) is new. - The organizational domain is found by a DNS Tree Walk instead of the Public Suffix List.
If mail from web applications is part of your traffic, make sure it leaves through the mail server your records cover. The open-source smarthost of epicsoft (Postfix on Alpine) does this for containers. Applications hand their mail to it, and it delivers the mail to the company’s mail server with authentication and TLS. Its option SMARTHOST_FORCE_FROM rewrites only the visible From: header, not the envelope sender.
In addition: MTA-STS for transport encryption
SPF, DKIM and DMARC protect the sender. MTA-STS protects the route. With it, a domain declares that mail to it must be delivered only over TLS with a valid certificate (RFC 8461). Two parts are needed:
- A TXT record at
_mta-sts.in front of the domain, for example_mta-sts.your-company.ge, that holdsv=STSv1and anid. The id changes whenever the policy changes. - The policy itself: the file
/.well-known/mta-sts.txt, served over HTTPS on the subdomainmta-stsof the domain, with the modeenforce,testingornone.
For esn.ge, _mta-sts.esn.ge is a CNAME to _mta-sts.epicsoft.email. The TXT record there reads exactly:
v=STSv1;id=20261012084000
So esn.ge takes its MTA-STS record from the mail domain epicsoft.email.
How epicsoft sets this up
With the email service of epicsoft networks, the mailboxes and the MX, SPF, DKIM and DMARC records of your domain are created as part of the setup. You can keep your domain: either the records are set up at your DNS provider together with you, or epicsoft manages the DNS. The mail is stored on epicsoft’s own mail servers in Finland and Germany. More services are listed under all services.
Sources
- epicsoft networks: Email: setup of the mailboxes and the MX, SPF, DKIM and DMARC records, mail servers in Finland and Germany
- epicsoft smarthost on GitLab: SMTP relay for containers and the option SMARTHOST_FORCE_FROM
- Google: Email sender guidelines: requirements for all senders and for senders of more than 5,000 messages a day, DKIM key length, spam rate, one-click unsubscribe
- Yahoo: Sender best practices: enforcement from February 2024, SPF or DKIM as the minimum
- Mailhardener: SPF lookup limit explained: limit of 10 DNS lookups in RFC 7208, section 4.6.4
- RFC 7208 (SPF): SPF record, mechanisms mx and include, -all
- RFC 6376 (DKIM): signature, selector and form of the DKIM key record
- RFC 9989 (DMARC): DMARC record, alignment, policies, rua, ruf, aspf, adkim and fo, the new tags np and psd, the companion documents RFC 9990 and RFC 9991
- RFC 8461 (MTA-STS): MTA-STS record, policy file and modes
- PowerDMARC: DMARC RFC 9989: publication in May 2026, name DMARCbis, move to Proposed Standard
- SMTPedia: RFC 9989: publication date and the obsoleted RFCs
- dmarcian: DMARC RFC updates: removed tags pct, rf and ri, new tag t
- DMARCTrust: DMARCbis, RFC 9989, 9990, 9991: DNS Tree Walk, records still start with v=DMARC1
- DNS query: TXT records of esn.ge: SPF record of esn.ge
- DNS query: _dmarc.esn.ge: DMARC record of esn.ge
- DNS query: _mta-sts.esn.ge: MTA-STS record of esn.ge