SPF, DKIM and DMARC: who can send email in your name

If your domain is not protected, anyone can send your customers a fake invoice from accounts@yourdomain.it. Here we explain, without jargon, what the three checks that prevent this do, and how to switch them on without blocking legitimate email.

Anyone can send email as your domain

Email was designed with no way of checking the sender. As with the return address on the back of an envelope, whoever sends a message can write any address they like: if the domain is not protected, a fraudster can send your customers an email from accounts@yourdomain.it, with your name prominently displayed and an invoice with a different IBAN. The customer pays, the money disappears, and the angry phone call comes to you.

Three checks published in the domain's DNS let anyone receiving your email tell genuine messages from forged ones. You do not need to change email provider, but the checks have to be switched on methodically.

The three checks, without jargon

What each one does

SPF (Sender Policy Framework): a list, published in the DNS, of the servers authorised to send email for your domain. The receiver checks whether the server that delivered the message is on the list.

DKIM (DomainKeys Identified Mail): a digital signature added to every message by the server that sends it. The receiver verifies it with a public key published in the DNS: if the message has been altered, or does not come from whoever holds the key, the signature does not match.

DMARC (Domain-based Message Authentication, Reporting and Conformance): the rule that tells recipients what to do with messages that fail the checks, and asks them to send you a report on what they have received in your name.

DMARC adds a requirement that is often overlooked: alignment. It is not enough for a message to pass SPF or DKIM for any domain at all; the verified domain must match the one the recipient sees in the From field. This is what stops a fraudster from passing the checks with their own domain while displaying yours.

The three DMARC policies

PolicyWhat it asks the receiver to doWhen to use it
p=noneNo action: deliver as usual, but send reportsAt the start, to see who is sending in your name
p=quarantineTreat messages that fail as suspicious, usually by moving them to spamOnce the legitimate senders have been fixed
p=rejectReject messages that failThe end goal: fake messages are not delivered

Since February 2024, Google and Yahoo have required SPF, DKIM and DMARC from anyone sending large volumes of email to their users. Even if you do not send newsletters to thousands of people, this is the direction of travel: a legitimate invoice from a domain that has not been configured risks ending up in spam just like a fake one.

The first step: who sends in your name

The real work is knowing who needs to appear in the records. Almost every company sends email in its own name from more places than you would expect:

  • business email, for example Microsoft 365;
  • the ERP that sends invoices, payment reminders and order confirmations;
  • the newsletter platform;
  • the CRM used by the sales team;
  • the website, with its contact forms and online orders;
  • the phone system that forwards faxes and voicemails by email.

When authorising them in SPF, there is a technical limit you need to know about: the SPF standard (RFC 7208) allows at most 10 DNS lookups to check a record. Every service added with an "include" uses at least one, the limit is reached sooner than you might think, and once it is exceeded SPF fails even for legitimate messages.

The process, one step at a time

  1. Inventory: every service that sends email in the domain's name, with the provider of each one.
  2. SPF and DKIM configured for each service, staying within the lookup limit.
  3. DMARC at p=none, with an address that receives the reports. For a few weeks you read them: they show who is sending in your name, who passes the checks and who does not. Often a service turns up that nobody had listed.
  4. Fixing the senders that fail, one by one, working with their respective providers.
  5. Moving to quarantine, while continuing to read the reports.
  6. Finally, moving to reject, once the reports show that only fake messages are failing.

Common mistakes

  • Going straight to reject. The invoices from the ERP, sent from a provider's server that was never authorised, are rejected by your customers' mail servers. You find out when a customer phones to ask where they are.
  • Stopping at p=none. The record is there, the reports arrive, nobody reads them. The domain can be spoofed just as before.
  • Forgetting the domains that do not send email. The old brand, the domain bought defensively: if they do not send email, you declare this with an SPF record that authorises no servers and a DMARC record set to reject. Otherwise they become the perfect sender for a scam.
  • Nobody responsible for DNS. In the story Seven suppliers, no one in charge, email was down for three days, most of them spent working out whose job it was. Put in writing who is allowed to change these records, as we explain in the guide on IT that lives in one person's head.

These checks protect your domain from people who forge it, but they do not stop someone who registers a domain similar to yours with one letter changed. For that you need people trained to recognise phishing.

In short

SPF says which servers can send for your domain, DKIM signs the messages, DMARC decides what to do with those that fail the checks and sends you reports. You start with an inventory of who sends in your name, observe at p=none, fix the senders and only then move to reject, without forgetting the domains that do not send email.

Frequently asked questions

What are SPF, DKIM and DMARC?

They are three checks published in the domain's DNS that let anyone receiving an email verify that it really comes from you. SPF lists the servers authorised to send, DKIM adds a digital signature to messages, and DMARC says what to do with those that fail the checks and asks for reports to be sent. Together they stop your domain from being used as the sender of fake emails.

What happens if I set DMARC straight to reject?

If any legitimate service is not yet authorised, for example the ERP that sends invoices or the newsletter platform, its messages are rejected by recipients. That is why you start with the p=none policy, read the reports for a few weeks, fix the senders and only then move to quarantine and finally to reject.

What is the SPF limit of 10 DNS lookups?

The SPF standard (RFC 7208) allows at most 10 DNS lookups to check a record. Every service added with an include uses at least one, and once the limit is exceeded SPF verification fails even for legitimate email. Before adding a new service, it is therefore worth checking how many lookups the record already uses.

Do domains that do not send email need protecting too?

Yes: an inactive but unprotected domain can be used as the sender of fake emails that appear to come from your company. You publish an SPF record that authorises no servers and a DMARC record with a reject policy, so recipients reject any message sent in its name.

Is your domain protected, or can anyone use it?

Knowing which systems send email in your name, and keeping track of them, is part of systems management. Tell us how your infrastructure is set up and we will start with the inventory.