Email that arrives: SPF, DKIM and DMARC explained
3 min read
Why emails land in spam
Gmail, Outlook and the other mail services receive huge numbers of fake emails every day that pretend to come from real domains. To defend themselves they check who is sending: if your domain does not declare which servers may send for it, or if the messages are not signed, your emails look just like the fake ones and end up in spam or are rejected.
SPF: who may send
SPF is a TXT record in the DNS that lists the servers allowed to send email with your domain. Its shape: v=spf1 include:… -all. Practical rules:
- One SPF record per domain: two records are an error.
- Every service that sends for you (site, mailboxes, newsletter, business software) must be in the record.
- The record has a limit of DNS lookups: too many "include" entries make it invalid.
DKIM: the signature
DKIM adds a digital signature to every email. The sending server signs with a private key; the receiver checks the signature with the public key published in the domain's DNS. If it matches, the message was not altered and really comes from who it says. Every service that sends for you has its own DKIM key and record.
DMARC: what to do with fakes
DMARC is a TXT record at _dmarc.yourdomain that tells receivers what to do with emails that fail SPF and DKIM: nothing (p=none), quarantine them (p=quarantine) or reject them (p=reject). Start with p=none and reports on, check that every real email passes, then go up.
The other factors
- The sending server: emails sent with the server's PHP mail function, without authentication, arrive worse than emails sent through an authenticated SMTP service.
- Volume: a thousand emails in a minute from a site that sends ten a day is a red flag.
- Consent: send newsletters only to people who asked, with an unsubscribe link that really works.
- Content: an honest subject, text as well as images, few links and all to your own or well-known domains.
- Wrong addresses: remove bounced addresses; writing again and again to addresses that do not exist lowers your reputation.
On Hostwebo
Emails sent by WordPress sites go through a monitored sending service, with an hourly limit per plan (from 100 emails an hour on Webo Eco to 2,000 on Webo Studio): it protects everyone's reputation and slows down at once a compromised site that tries to send spam. Mailboxes on your domain work with any mail app over IMAP and send over authenticated SMTP, with automatic setup for the most common apps. If your domain's DNS is not managed by us, the SPF, DKIM and DMARC records are added where it is managed: write to us and we check together that they are right.
Checklist
- One SPF record, with every service that sends for you.
- DKIM on for every sending service.
- A DMARC record, at least
p=nonewith an address for reports. - The site sends over authenticated SMTP, not with the PHP mail function.
- Newsletters only with consent, with one-click unsubscribe.
- Test sends to Gmail and Outlook mailboxes and a look at the headers: SPF, DKIM and DMARC must say "pass".