Skip to content

Infrastructure and servers

Business email landing in spam: check SPF, DKIM and DMARC

Guide that separates authentication (SPF, DKIM, DMARC and alignment) from reputation, with an inventory of services that send with your domain, a 7-step diagnostic sequence using the header of a real message, a decision tree for reading Authentication-Results and the p=none → reports → enforcement path under RFC 9989. Includes Gmail and Outlook.com sender requirements and a fictional example of invoices that passed SPF and failed DMARC.

In this guide
Laptop showing an inbox of envelopes where one moves to a separate folder, and three green protection shields.

A quote the customer never saw. An invoice that turned up in spam three days later. The temptation is to switch providers or rewrite the messages. First, separate two questions: whether the receiver can verify that the message came from your domain, and how trustworthy it considers that sending. This guide diagnoses the first one, using a real message.

Authentication and reputation: two different questions

SPF, DKIM and DMARC answer whether a message that claims to come from your domain is authorized by your domain, not whether the recipient wants it. The current DMARC standard is RFC 9989, published in May 2026 as an IETF standard; together with RFCs 9990 and 9991, which cover reporting, it replaced RFC 7489. Its text is explicit: a DMARC pass only indicates that the use of the domain was validated, and by itself it does not guarantee inbox delivery.

Reputation is the other half. Gmail also asks for forward and reverse DNS records (PTR) for the sending server, a TLS connection, correct formatting and a spam rate in Postmaster Tools below 0.3%, ideally below 0.1%. In its Outlook.com requirements, Microsoft notes that authentication proves the mail is yours, but recipient perception still matters. Hence the order: authentication and alignment first; then reputation, lists and content.

What each record checks

RecordWhat it checksWhere it livesTypical failure
SPF (RFC 7208)That the delivering server is authorized for the envelope sender domain (MAIL FROM)TXT starting with v=spf1A service is missing; two records; more than 10 DNS lookups
DKIM (RFC 6376)That the message carries a domain's signature (d=) and was not alteredPublic key at selector._domainkeySigns with the provider's domain; selector not published
DMARC (RFC 9989)That the From domain matches the one that passed SPF or DKIM, and what the owner asks if it failsTXT at _dmarcMissing; p=none with no one reading reports; no alignment

The envelope sender is the technical address the server uses to deliver the message and receive bounces; recipients rarely see it, and many services put their own domain there. Alignment means the From domain matches the one that passed SPF or the one that signed with DKIM. According to Microsoft Learn, a message passes DMARC if at least one of the two passes aligned, and fails only if both fail.

In SPF, two rules explain many rejections. A domain can have only one record: with more than one, RFC 7208 returns permerror, meaning the record cannot be evaluated. And evaluation allows at most 10 terms that trigger DNS lookups (include, a, mx, ptr, exists and redirect); past that limit, the result is also permerror.

Who sends with your domain

Usually it is a service nobody remembered. Before touching DNS, list what sends with your domain: the email platform, website forms, the CRM, newsletters, electronic invoicing, the ERP, ticketing and any server that sends alerts. For each one, note the From address, the DKIM signing domain, the envelope sender and who manages the account.

Gmail asks that your SPF record include everyone who sends for your domain and that you verify your email service provider authenticates it. Microsoft recommends a subdomain for services you do not control directly, such as bulk email, so their reputation does not drag down your users' mail. The diagnostic log that comes with this guide puts that list in writing.

Diagnosis with a real message

  1. Get a message that landed in spam for an external recipient; one sent to yourself does not go through the same filters.
  2. Open the full headers. In Gmail: More, Show original. You can also paste them into Messageheader, in the Google Admin Toolbox.
  3. In Authentication-Results, note spf=, dkim= and dmarc=, the From domain, the envelope sender domain (smtp.mailfrom) and the signing domain (header.d).
  4. Compare domains. If the From is billing@example.com but SPF and DKIM passed with the provider's domain, you have authentication without alignment.
  5. Check DNS: how many v=spf1 records exist, how many lookups they add up to, whether the selector's key exists and what _dmarc says.
  6. Fix one service at a time: add it to the single SPF record, turn on DKIM with your domain in its panel or create the missing DMARC record.
  7. Send a new message from that service, repeat steps 2 to 4 and save the dated header.

How to read Authentication-Results

What you seeWhat it meansWhat to check next
dmarc=pass and lands in spamAuthentication is fineReputation, complaints, consent, volume, content
spf=fail or softfailThe server is not in your SPFWhich service sent it
spf=permerrorSPF cannot be evaluatedDuplicate records or more than 10 lookups
dkim=noneNo signatureTurn on DKIM with your domain
dkim=failThe signature does not verifySelector and key, or an intermediary that altered the message
spf and dkim pass, dmarc=failNo alignment with the FromHave the service sign or send with your domain
dmarc=noneNo policyCreate _dmarc with reports
5.7.26 rejection (Gmail) or 550 5.7.515 (Outlook.com)The receiver requires authenticationThe service that sent it

From p=none to a strict policy

RFC 9989 describes the usual path: with SPF and DKIM in place, you publish p=none with the rua tag to receive aggregate reports. That is monitoring mode. The reports, in XML and meant to be read with a tool, show which sources use your domain and which fail; legitimate ones are fixed before moving to quarantine or reject. The standard warns that, depending on sending cadence, it may take many months of reports to be sure. Jumping to reject without reading them can block invoices from a forgotten service.

Compared with the previous specification there are three changes. The pct tag, which applied the policy to a percentage of messages, was removed. There is t=y to declare that you are testing, with the expectation that the receiver applies one level less strict (quarantine instead of reject, or none instead of quarantine). And a domain with p=reject must not rely solely on SPF: it needs DKIM signatures, because forwarding tends to break SPF while DKIM tends to survive. When rotating DKIM keys, RFC 6376 says to keep the old and new keys published during the transition.

What Gmail and Outlook.com ask of senders

ProviderAll sendersMore than 5,000 messages a day
Gmail (personal accounts)SPF or DKIM, valid PTR, TLS, spam below 0.3%, RFC 5322 formatSPF and DKIM, DMARC (p=none is enough), aligned From, one-click unsubscribe in marketing messages
Outlook.comEncourages all senders to review SPF, DKIM and DMARCSPF and DKIM passing, DMARC at least p=none aligned with SPF or DKIM

For non-compliant senders on Outlook.com, Microsoft announced routing to Junk and rejection with code 550 5.7.515. Gmail requires DKIM keys of at least 1,024 bits and recommends 2,048 if your provider supports it. Meeting the strict requirements before you reach 5,000 messages a day avoids rejections when a newsletter grows.

Fictional example: invoices that passed SPF and failed DMARC

This case is invented; it is not a RealStack or client case. A distributor uses Microsoft 365 and an external platform that sends invoices from billing@ on its domain, and several customers find them in spam. The header shows spf=pass and dkim=pass with the platform's domain, and dmarc=fail for the distributor's. DNS also shows two v=spf1 records, one left over from the web host. The distributor merges them, turns on DKIM signing with its own domain in the platform and publishes the selector. The test shows dmarc=pass; it keeps p=none and schedules a report review before tightening the policy.

What this review does not solve

This diagnosis covers authentication. It does not cover how to change servers or DNS without cutting service, or who owns the domain and the accounts; for that there are RealStack's guide on domain, hosting, SSL and access control and its asset inventory with owners and renewals. Nor does it guarantee the inbox: each receiver decides with its own filters. If you send newsletters, consent for your list has legal implications in Colombia; check it with your lawyer.

If your project has a RealStack Continuity plan, confirm in the proposal whether email and its DNS records are within scope; do not assume they are included. And if you are deciding where to host your website, see the guide on shared hosting, VPS or managed cloud.

Bring it to your business

Email authentication diagnostic log

CSV template to list every service that sends email with your domain and record, using the header of a real message, what result it gets for SPF, DKIM and DMARC, whether it is aligned and who is responsible for the account.

View resource
If my email passes SPF, DKIM and DMARC, why does it still land in spam?

Because authentication only proves the message comes from your domain; RFC 9989 makes clear that a DMARC pass does not guarantee delivery. Review reputation, complaints, list origin, volume and content.

Can I have two SPF records, one for each provider?

No. Under RFC 7208, more than one SPF record returns permerror. Merge the services into one and watch the 10-DNS-lookup limit.

Which DMARC policy should I start with?

With p=none and aggregate reports (rua), as RFC 9989 describes. Fix the legitimate sources that fail and then consider quarantine or reject.

Authorship and sources

Author: Andrés Florez · RealStack