Skip to main content
Legia

Cybersecurity

SPF, DKIM, and DMARC: Keeping Company Email From Being Spoofed or Sent to Spam

Without SPF, DKIM, and DMARC, anyone can send email in your company domain's name, and legitimate email increasingly lands in spam. Here is what management needs to decide and what the IT team needs to do.

SEO and Content Specialist

8 min read Reviewed by Legia Cybersecurity Team

An open padlock on a keyboard in blue light

Short answer: SPF lists the servers allowed to send email in the domain’s name, DKIM adds a digital signature whose public key sits in DNS, and DMARC tells recipients what to do when an email passes neither SPF nor DKIM in alignment with the sender address, while also sending reports to the domain owner. Roll them out in stages: register every sending service, start DMARC at p=none, read the reports, then move up to quarantine and reject.

Setting up SPF, DKIM, and DMARC for company email used to be seen as a minor technical task. Since 2024 that has changed: Google and Yahoo require email senders to authenticate, and Microsoft followed for Outlook.com in 2025. Meanwhile, a domain without a strict DMARC policy can be used by anyone to send fake email that appears to come from the board or the finance department. This article is for management and IT teams who need to put the company domain in order: what each record does, how the work is divided, the rollout order, and how to read DMARC reports.

What do SPF, DKIM, and DMARC do?

SPF, DKIM, and DMARC are three TXT records in the domain’s DNS that together prove an email was really sent with the domain owner’s permission. Each checks something different, and each has limits.

RecordLocation in DNSWhat it provesIts limits
SPFTXT on the domain, starting with v=spf1The sending server is one the domain allowsChecks the envelope domain (MAIL FROM), not the From address the reader sees; at most 10 DNS lookups
DKIMTXT at <selector>._domainkey.<domain>The signed parts of the email have not changed, and the signer holds the key for the domain in the d= tagThe signing domain does not have to match the From address
DMARCTXT at _dmarc.<domain>, starting with v=DMARC1The domain in the From address aligns with the domain that passed SPF or DKIMOnly protects that exact domain, not look-alike domains

The last column explains why SPF and DKIM alone are not enough. Both can pass for a domain owned by someone else, while the reader only sees the From address. DMARC connects their results to the address the reader sees, through alignment rules. By default alignment is relaxed: mail.perusahaan.co.id is considered aligned with perusahaan.co.id. Strict mode requires exactly the same domain.

Illustration: cybersecurity

Why it can no longer be postponed

Gmail, Yahoo, and Outlook.com now hold back or reject email from domains that are not authenticated. A summary of the requirements:

ProviderAll sendersBulk senders
Gmail (in effect since February 1, 2024)SPF or DKIM, a valid PTR record, a TLS connection, spam rate below 0.3%More than 5,000 emails a day to Gmail: SPF and DKIM, DMARC at least p=none with alignment, one-click unsubscribe for marketing email
YahooSPF or DKIM, spam rate below 0.3%SPF and DKIM, DMARC at least p=none that passes, one-click unsubscribe, unsubscribe requests honored within 2 days
Outlook.com (enforced from May 5, 2025)Not covered in this announcementMore than 5,000 emails a day to outlook.com, hotmail.com, and live.com: SPF and DKIM pass, DMARC at least p=none aligned with SPF or DKIM

Microsoft routes email from bulk senders that do not yet meet the requirements to the Junk folder, and has stated that such email will be rejected in the future. Google also requires DKIM keys of at least 1024 bits and recommends 2048 bits if your provider supports it.

The 5,000-emails-a-day threshold feels far off for many companies, but the requirements for all senders already ask for SPF or DKIM. Besides, p=none is only the providers’ minimum. As long as the policy is not yet quarantine or reject, the company domain can still be spoofed.

What management decides, what the IT team does

DMARC rollouts often stall not because the technical part is hard, but because nobody knows which services send email in the company’s name. So there are decisions management has to make first:

  • Who holds DNS access. Who holds the domain’s DNS panel, and who is authorized to approve changes to it.
  • The list of sending services. Office email (for example Google Workspace or Microsoft 365), email marketing tools, CRM, the billing system, website forms, and the ticketing system. Services that are not listed will be held back or rejected once the policy is tightened.
  • Target and deadline. The final policy being aimed for, usually reject, and when it must be reached.
  • Who reads the reports. Who reads the DMARC reports every week and follows up on them.

The IT team then handles the records: one SPF record covering all services, DKIM on each service (every provider gives its own selector and public key), and a DMARC record with the report recipient address. If the company runs its own mail server, the private DKIM key is stored and used for signing on that server, so whoever manages the server shares responsibility for maintaining it. The scope of server management at Legia is on the Server Installation & Management page.

Rollout order: from p=none to reject

The safe rollout order for SPF, DKIM, and DMARC is to monitor first, then enforce:

  1. Inventory the senders. Complete the list of services above, including those used by a single division.
  2. Set up SPF. Only one record, containing all sending services. Use ~all (softfail) while the list is not yet certain, then -all once it is complete.
  3. Enable DKIM on every service with your own domain, using a 2048-bit key if supported.
  4. Publish DMARC with p=none and a report address, for example v=DMARC1; p=none; rua=mailto:dmarc@perusahaan.co.id. RFC 9989 calls this stage monitoring mode: recipients change nothing about how mail is handled, but start sending reports.
  5. Read the reports and fix legitimate services that still fail, until the only failures left are senders you do not recognize.
  6. Move up to p=quarantine. Failing email is sent to the spam folder rather than rejected.
  7. Move up to p=reject, then set the policy for subdomains with the sp tag, and for non-existent subdomains with the np tag.

As a timing guide, RFC 9989 advises domains whose users are active on mailing lists to use p=none for at least a month, then p=quarantine for the same length of time, before p=reject.

Older guides often recommend the pct tag to apply the policy to a share of email first. This tag has been removed in RFC 9989, the DMARC standard that replaces RFC 7489. Its replacement is the t=y tag (test mode), which asks recipients to apply a policy one level softer: quarantine is treated like none, and reject like quarantine.

How to read DMARC reports

DMARC aggregate reports are XML files, usually compressed as .xml.gz, sent daily to the address in the rua tag by recipients that support them. They contain: the reporter’s name, the date range, the policy as read, then a row per sending IP address with the number of emails, the SPF and DKIM results with their domains, and the handling applied. Reading raw XML is tiring, so IT teams generally use a report reader tool. What to look for is the pattern:

What the report showsWhat it probably meansAction
Your service’s IP, DKIM passes and alignsAlready correctNone
Your service’s IP, SPF passes but does not alignThe service uses its own envelope domainEnable DKIM with your domain in that service
Your service’s IP, everything failsThe service has not been registeredAdd it to SPF and enable DKIM before moving to quarantine
An intermediary IP, SPF fails but DKIM passesThe email was forwardedNormal, DKIM stays intact as long as the email content is not changed
An unknown IP, everything failsLikely spoofingThis is the email that will be held back once the policy is tightened

The last row is the business case for DMARC: the reports show who is trying to use your domain’s name, before any customer is deceived.

Common mistakes that make a rollout fail

  1. More than one SPF record. RFC 7208 sets the result to permerror, so SPF is treated as broken for all email.
  2. More than 10 DNS lookups in SPF. Each include adds to the count, and going past 10 also produces permerror.
  3. Forgotten services. A billing system or website form left out of the inventory will be held back as soon as the policy becomes reject.
  4. Jumping straight to reject without reading the p=none reports.
  5. Thinking DMARC stops all phishing. DMARC only protects your own domain. Look-alike domains, for example with swapped letters, are outside its reach.

Rejected email is not always about domain records either. An office IP address on a blocklist because of office devices infected by a botnet produces similar symptoms.

Email spoofing is only one way a company domain gets misused. Beyond email records, Legia’s Vulnerability Assessment maps flaws in internet-connected websites, applications, servers, and the cloud, then organizes them into a prioritized report based on CVSS. The process usually takes 2 to 4 weeks, with retesting after fixes included. How it differs from deeper testing is explained in the article vulnerability assessment or penetration testing.

Frequently asked questions

Our company uses Google Workspace or Microsoft 365. Do we still need to set this up ourselves?

Yes. The email provider supplies the SPF values and DKIM key, but those records must be added to your domain’s DNS by whoever holds DNS access. The DMARC policy and its report recipient address are also the domain owner’s decision, not the provider’s.

Can p=reject make legitimate email disappear?

It can, if a sending service has not been registered in SPF or is not yet signing with DKIM. That is why the p=none stage and reading the reports must not be skipped.

How long until a domain can use p=reject?

It depends on the number of sending services and how quickly they are fixed. As a guide, RFC 9989 advises at least a month at p=none and a month at p=quarantine for domains whose users are active on mailing lists.

Does DMARC stop all phishing email?

No. DMARC prevents spoofing of your exact domain. Email from look-alike domains or from public email accounts is not covered, so employee vigilance is still needed.

Sources

Details on the scope of the assessment are on the Vulnerability Assessment page, or see all of Legia’s Cybersecurity services.

Category Cybersecurity

Keep reading

Related articles

All Articles