Corporate email: deliverability and security with SPF, DKIM, and DMARC
Nanda Teknoloji Engineering Team · · 8 min read
In brief
SPF determines which servers may send mail on behalf of your domain, DKIM confirms that a message was not altered in transit, and DMARC decides what the recipient does when these two checks fail and how it reports back to you. Together the three reduce both spoofing and delivery problems.
Three DNS-based checks work together so that emails sent from your corporate domain reach their destination and forged emails are blocked. SPF lists which servers may send mail on behalf of your domain. DKIM stamps each message with a digital signature and lets the recipient verify that the content was not altered in transit. DMARC tells the recipient what to do when one of these two checks fails (nothing, quarantine, reject) and sends you aggregate reports. When all three are set up correctly, brand impersonation (spoofing) becomes harder and the likelihood of your messages landing in the spam folder falls. This article explains how the records work, in what order and how to roll them out safely, and the most common mistakes.
Why is email authentication essential?
By design, the SMTP protocol does not verify the accuracy of the sender address. So an attacker can alter the header and appear to be sending a message from “ceo@yourcompany.com”. The consequences are familiar: fake invoices and payment requests, phishing, and spam in your brand’s name that damages customer trust. In addition, major mailbox providers are increasingly harsh toward messages without authentication. In other words, these records are a matter not only of security but of deliverability.
Remember that corporate email infrastructure is a service that must be managed continuously; to think about server, record, and reporting processes together, you can also look at the corporate email solution page.
SPF: who can send?
SPF (Sender Policy Framework, RFC 7208) is published as a TXT record in your domain’s DNS. The receiving server checks whether the IP address that sent the message is on this list. An example record:
v=spf1 ip4:203.0.113.10 include:_spf.email-provider.example -all
The components are:
- v=spf1: Indicates that the record is SPF.
- ip4 / ip6: Addresses that are directly permitted.
- include: Includes the SPF record of another provider (for example a bulk email or CRM tool).
- -all (hardfail), ~all (softfail): Says what to do with anything not on the list. Once verification is complete,
-allis the target.
SPF has two known limits. First, one evaluation may require at most 10 DNS lookups; adding many include entries can exceed this limit and break the record. Second, SPF verifies only the envelope sender (Return-Path), not the “From” address the user sees; moreover, SPF usually fails when messages are forwarded. For these two reasons, SPF alone is not enough.
DKIM: was the message changed?
DKIM (DomainKeys Identified Mail, RFC 6376) uses a cryptographic signature. The sending server signs selected headers and the body of the message with its private key; the signature is added to the message as a DKIM-Signature header. The recipient verifies the signature with the public key published in DNS. The public key is published under a selector:
selector1._domainkey.yourcompany.com TXT "v=DKIM1; k=rsa; p=<public key>"
DKIM is more resilient than SPF in forwarding, because the signature travels with the message; but the signature can break when the content is modified (for example when a mailing list adds a footer). Points to watch in practice:
- Use an adequate key length and rotate keys at regular intervals; using selectors lets you do this without interruption.
- Each sending system (email server, newsletter tool, ticketing system) should sign with its own selector.
- Verify that the private key exists only on the signing system.
DMARC: policy and reporting
DMARC (Domain-based Message Authentication, Reporting and Conformance, RFC 7489) aligns the SPF and DKIM results with the “From” domain the user sees (alignment). That is, even if SPF or DKIM passes, DMARC does not pass if the authenticated domain does not match the “From” domain. The record is published under the _dmarc subdomain:
_dmarc.yourcompany.com TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@yourcompany.com"
The main fields:
- p: Policy:
none(report only),quarantine(mark as suspicious),reject(reject). - rua: The address to which aggregate reports are sent.
- adkim / aspf: Whether alignment will be strict or relaxed.
- sp: Policy for subdomains.
The real value of DMARC is the reports: you see from which IPs, and how much, mail is sent on behalf of your domain, and which of it passes verification. A forgotten sender system that nobody knows about usually shows up first in these reports.
The three working together: summary table
| Mechanism | What does it verify? | Where is it published? | Resilience in forwarding | Limit |
|---|---|---|---|---|
| SPF | Is the sending IP authorized? | Domain TXT record | Weak | 10 DNS lookup limit, does not verify the visible “From” |
| DKIM | Was the message unchanged, is the signature valid? | TXT under a selector | Good | Breaks if content changes |
| DMARC | Are SPF/DKIM aligned with “From”? What to do on failure? | _dmarc TXT |
Depends on SPF or DKIM | The policy can only be tightened gradually |
Staged rollout, step by step
Jumping straight to a strict policy can make you lose legitimate email. The safe path is:
- Build a sender inventory. Email server, newsletter tool, CRM, ticketing system, accounting software, website contact forms: list everything that sends mail on behalf of your domain.
- Create the SPF record. Add all legitimate senders and check the DNS lookup limit. You can use
~allat the start. - Enable DKIM on every sending system. Add a selector and public key record for each system; verify the headers with test messages.
- Publish DMARC with
p=noneand collect reports at theruaaddress. Using an analysis tool or service that makes the reports readable makes the job much easier. - Observe the reports. Over a cycle of a few weeks, find and fix legitimate senders that fail verification.
- Move to the
quarantinestage. If needed, apply it first at a limited percentage (pct). - Advance to the
rejectstage. If you are sure no legitimate sender remains, this stage provides the real protection against spoofing. - Monitor continuously. When a new SaaS tool is added, the records must be updated.
The neglected side of this process is ownership: who will update the records and who will read the reports must be clear. To keep this work running regularly, a managed services model or assigning an owner on the in-house team is appropriate.
Example scenario: a forgotten sender
A company publishes DMARC with p=none and examines the first week’s reports. In the reports, an IP block that sends mail on behalf of the domain, and that nobody recognizes, appears. The investigation shows that a newsletter tool the marketing unit used years ago is still active and was not included in SPF and DKIM. In the same reports, it is also seen that notifications sent by the ticketing system fail DMARC because they are not signed with the company’s own domain.
The team does two things: it shuts down the unused tool and enables custom domain signing for the ticketing system. A few weeks later, the reports clean up and the policy is moved to quarantine and then reject. Had the policy been reject from day one, the ticket notifications would have been silently rejected. This scenario shows why DMARC reports are the basis of the “monitor first” approach.
Reading DMARC reports
DMARC produces two types of reports. Aggregate reports (rua) are in XML format and contain a daily summary: source IP, message count, SPF and DKIM result, applied policy. Forensic reports (ruf) contain detail about individual failed messages; many providers do not send them for privacy reasons. Reading raw XML by hand is laborious; using a tool or service that collects and visualizes the reports is practical.
When reading a report, ask these questions:
- Do I recognize this source IP? Which system or provider does it belong to?
- If it is a legitimate sender, why does it fail SPF or DKIM alignment?
- Is the volume from sources I do not recognize increasing? Could this be a spoofing attempt?
- Is there unexpected traffic from subdomains?
Reviewing the reports regularly (for example weekly) is the cheapest way to keep the records current.
Common mistakes
- Publishing more than one record in SPF: A domain should have a single SPF record; two records invalidate the result.
- Exceeding the 10-lookup limit: Adding many
includeentries. If necessary, clean up unused services. - Using
+all: It permits everyone; it renders SPF meaningless. - Never rotating the DKIM key: Weak keys created years ago carry risk.
- Tightening DMARC without reading reports: Legitimate newsletter or billing mail gets rejected.
- Forgetting subdomains and parked domains: Attackers usually choose unprotected domains.
- Skipping alignment: If a third-party tool signs with its own domain, DMARC does not pass; a custom domain signature is needed.
Other layers of email security
Authentication reduces spoofing but does not by itself solve content-based threats. Layers such as scanning of malicious links and attachments in inbound mail, multi-factor authentication against account takeover, and employee awareness are also necessary. Because a significant share of ransomware incidents begin with email, for post-incident steps see the first 24 hours after a ransomware attack article, and for the prevention and preparation framework see CISA’s #StopRansomware page. For new risks such as employees pasting email content into AI tools, the Shadow AI article is complementary.
Decision summary
- List all systems that send mail on behalf of your domain.
- Publish SPF as a single record, without exceeding the lookup limit.
- Enable DKIM for every sender and make a key rotation plan.
- Start DMARC with
noneand read the reports. - Move gradually to
quarantineand thenreject. - Protect the domains that do not send email as well.
- When adding a new service, tie record updates to the change process.
Moving forward with Nanda Teknoloji
Nanda Teknoloji carries out the discovery, design, migration, and operation steps in projects like these: sender inventory, preparing the records, DMARC report analysis, and gradual tightening. To address authentication, deliverability, and operational responsibilities together in your corporate email infrastructure, you can explore the corporate email solution.