Guides · E-mail security · 6 min read
E-mail security: SPF, DKIM and DMARC simply explained
Anyone can enter "from your-company.com" as the sender in an e-mail. Fraudsters exploit exactly this for phishing. SPF, DKIM and DMARC are three records in the DNS of your domain that prevent this or at least make it recognisable. And they make sure your genuine mails land in the inbox instead of in spam.
The three building blocks
- SPF: who may send for my domain?A record in your DNS lists the servers and services that may send e-mails with your domain. Recipients check whether the sending address belongs to it.
- DKIM: is the mail genuine and unaltered?The mail server digitally signs every outgoing message. You publish the matching public key in the DNS. Recipients use it to verify the signature.
- DMARC: what happens on failure?DMARC defines how recipients should handle mails that fail SPF and DKIM: let through, move to spam or reject. You also receive reports on who sends in your name.
Examples (with an example domain)
These records are only samples. The right values depend on your mail provider.
SPF (TXT record for example.com): allows the domain's mail servers and one external service, everything else is rejected.
v=spf1 mx include:_spf.mailanbieter.example -all
DKIM (TXT record for selector._domainkey.example.com): the value is supplied by your mail server or provider.
DMARC (TXT record for _dmarc.example.com): initially only observe and send reports to an address.
v=DMARC1; p=none; rua=mailto:dmarc@beispiel.de
Roadmap for introduction
- Take stockWhich systems send e-mail with your domain? Mail server, newsletter tool, helpdesk, accounting, website forms, printers or scanners.
- Set up SPF and DKIMAdd every sender to SPF and enable DKIM for it. Then verify with test mails.
- Start DMARC with "p=none"Collect reports for two to four weeks. They show whether legitimate senders are still missing.
- Tighten step by stepFirst "p=quarantine" (suspicious mails to spam), later "p=reject" (reject). This keeps genuine mail traffic protected while forgeries stay out.
Typical stumbling blocks
- SPF allows only a limited number of DNS lookups (maximum 10). Too many included services make the record invalid.
- Third-party services are forgotten and their mails suddenly land in spam or are rejected.
- Only one SPF record may exist per domain.
- Forwarded mails can break SPF. DKIM helps here.
- Unused domains should be protected too, ideally with a record that allows no sending at all.
Why it is worth it
- Fraudsters can no longer abuse your domain so easily for phishing against your customers.
- Your mails arrive more reliably. Large providers increasingly require these methods, especially for high mail volumes.
- In the DMARC reports you see who sends in your name.
How to check your domain
Send a mail to your own mailbox at a large provider and open the headers there. They contain test results for SPF, DKIM and DMARC; the notes "pass" or "fail" are helpful. If you are unsure, we are happy to check your records.
One more building block of protection: recognising phishing. We are happy to take care of e-mail protection for you, see prices. How good your phishing protection is today is shown by the IT check.
Frequently asked questions
Do I have to set up all three?
It is recommended. DMARC builds on SPF and DKIM, and only all three together protect your domain effectively.
How quickly do the records take effect?
DNS changes usually take effect after minutes to a few hours. Gradually tightening DMARC takes a few weeks depending on the evaluation.
Can I block my own mails with it?
Yes, with a wrong configuration. So start with DMARC p=none, evaluate the reports and only then tighten.