Emails Going to Spam? Fix SPF, DKIM and DMARC

Emails going to spam or bouncing back often means your domain can’t prove the mail is really yours. Check three records in five minutes, then fix what’s missing.

Subject
Why mail from your domain lands in spam or bounces, and how to check and fix the three records that decide it
Published
15 OCT 2026
Reading time
7 min

In short

Why it happens
Inboxes send mail to spam, or bounce it, when they can’t tell it came from you, or the address is wrong.
The fix
Check three records on your domain, add any that are missing, then send a test and read the result.
If it bounced
The error code tells you why. A 550 5.1.1 means that address doesn’t exist.
In this post · 14 sections
  1. —In short
  2. 01Check yours in five minutes
  3. 02Why are my emails going to spam?
  4. 03What are SPF, DKIM and DMARC?
  5. 04Do I need DMARC?
  6. 05How do I set up SPF, DKIM and DMARC?
  7. 06DMARC p=none vs quarantine vs reject: which should I use?
  8. 07What are DMARC aggregate report emails?
  9. 08How do I check that SPF, DKIM and DMARC pass?
  10. 09What does 550 5.1.1 user unknown mean?
  11. 10What does “Mail delivery failed” or “Delivery Status Notification (Failure)” mean?
  12. 11Why does my contact form email bounce?
  13. 12Can someone send email pretending to be my domain?
  14. 13What are the Gmail and Yahoo bulk sender requirements?
  15. 14In what order should I fix this?

Emails going to spam, or bouncing back, often means the other side couldn’t tell the mail really came from you. Three records on your domain help prove it. SPF (Sender Policy Framework) lists who may send for you. DKIM (DomainKeys Identified Mail) is a digital signature proving a message came from your domain. DMARC (Domain-based Message Authentication, Reporting and Conformance) says what to do when those checks fail.

Check yours in five minutes

Run these three lookups, swapping in your own domain and your mail provider’s DKIM selector. Use a public DNS (domain name system) server like 8.8.8.8, not your router, because some internet providers fake answers for names that don’t exist. No command line? An online DNS lookup tool works too: pick TXT as the record type and enter the names below.

dig +short TXT example.com @8.8.8.8
dig +short TXT _dmarc.example.com @8.8.8.8
dig +short TXT selector._domainkey.example.com @8.8.8.8
  1. SPF. The first lookup should show exactly one line starting v=spf1. That’s a TXT record, a line of text stored in your domain’s DNS settings.
  2. DKIM. The third lookup should show your key, usually starting v=DKIM1. Swap in the selector (the label in front) that your mail provider names; Google Workspace uses google.
  3. DMARC. The second lookup should show a line starting v=DMARC1. No answer usually means you haven’t published one yet.
  4. Headers. Send a test from your domain to a different Gmail address and open Show original, which displays the message’s headers (technical details about its sender and checks). SPF, DKIM and DMARC should each say PASS.
  5. Other senders. Repeat the test from every service that sends as your domain: forms, newsletters, invoicing.

Why are my emails going to spam?

Often because the inbox can’t tell the mail really came from you: SPF, DKIM or DMARC is missing, set up wrong, or doesn’t match the address in the From line. Complaints, a poor sending reputation and misleading messages can do it too. Check your authentication first.

Check the three records first. Google says mail that isn’t authenticated may land in spam or be rejected with a 5.7.26 error. If all three pass, keep your spam rate in Google’s Postmaster Tools below 0.10%, and don’t email people who didn’t ask for it. Google’s sender guidelines cover the rest.

What are SPF, DKIM and DMARC?

SPF is the list of servers allowed to send mail for your domain. DKIM is a digital signature that proves a message really came from your domain. DMARC ties them to the address people see in the From line, tells inboxes what to do with fakes, and sends you reports.

DMARC passes when SPF or DKIM passes and the domain that passed matches the one in the From line. By default, the same main domain is enough; strict mode wants an exact match. So a message can pass SPF and still fail DMARC if a service sent it using its own domain.

Do I need DMARC?

If you send about 5,000 or more emails a day to Gmail addresses, yes. Gmail requires it, and Yahoo asks the same of bulk senders. If you’ve never sent that much, Gmail doesn’t require it. It’s still free, and its reports show who is sending mail as your domain.

Once your domain has hit that volume, Gmail treats it as a bulk sender for good. A policy of p=none is enough to meet the rule.

How do I set up SPF, DKIM and DMARC?

Add or update three TXT records, in that order, wherever your domain’s DNS is managed. If you already have an SPF record, edit it instead of adding a second.

How do I set up SPF?

Add one TXT record to your domain, using the value your mail provider gives you. If Google Workspace is your only sender, it’s v=spf1 include:_spf.google.com ~all. You get one SPF record per domain, so put every sender in that same line.

Type:  TXT
Name:  @   (or blank, or your domain, depending on the provider)
Value: v=spf1 include:_spf.google.com ~all

SPF allows at most 10 lookups, counting nested ones, and each include: counts, so don’t pile on services you don’t use.

How do I set up DKIM for Google Workspace?

In the Google Admin console, go to Apps, Google Workspace, Gmail, Authenticate email. Pick your domain and click Generate New Record. Choose a 2048-bit key if your DNS provider accepts it, and keep the default prefix, google. Add the TXT record Google shows you at your DNS provider, then click Start authentication.

Click Start authentication only after the record is in place. Google says DKIM can take up to 48 hours to start working. When the status says “Authenticating email with DKIM”, signing is on.

How do I add a DMARC record?

Add a TXT record named _dmarc with the value v=DMARC1; p=none; rua=mailto:you@example.com. Do it at least two days after SPF and DKIM. The p=none part means watch only, so DMARC itself blocks nothing.

Type:  TXT
Name:  _dmarc
Value: v=DMARC1; p=none; rua=mailto:you@example.com

Swap you@example.com for a working mailbox on your domain.

DMARC p=none vs quarantine vs reject: which should I use?

Start with p=none. It only watches and reports. Later, quarantine sends failing mail to spam, and reject asks inboxes to refuse it. Move up one step at a time, and only once your reports show all your real mail passing.

Google suggests about a week at p=none, then quarantine for a small share of mail using the pct tag, raised over time to 100%:

v=DMARC1; p=quarantine; pct=5; rua=mailto:you@example.com

Be careful with reject: a forgotten service that sends as you, such as an invoicing tool, can have its mail refused without you knowing.

What are DMARC aggregate report emails?

They’re daily summaries that inbox providers email to the address in your DMARC record. Each one lists who sent mail as your domain, how many messages, and whether SPF and DKIM passed.

They arrive as ordinary emails with a compressed file attached, written for software. Send them to a folder that skips your inbox. When you do look, watch for servers you don’t know sending as you, and for your own services whose mail fails DMARC. Fix those before you leave p=none.

How do I check that SPF, DKIM and DMARC pass?

Send an email from your domain to a Gmail address and open it. Click the three dots, then Show original. You want PASS next to SPF, DKIM and DMARC. In the raw text, the Authentication-Results line should say spf=pass, dkim=pass and dmarc=pass.

Authentication-Results: mx.google.com;
   dkim=pass header.i=@example.com header.s=google;
   spf=pass smtp.mailfrom=you@example.com;
   dmarc=pass header.from=example.com

Send to a different account, because you can’t check DKIM by emailing yourself. If a service shows spf=fail or dmarc=fail, that’s a sender you still need to fix.

Why does a DNS lookup show a strange IP address?

Some internet providers answer a made-up or missing name with the address of their own search or ad page, instead of saying it doesn’t exist. Ask a public DNS server such as 8.8.8.8 instead to see what’s actually published.

What does 550 5.1.1 user unknown mean?

It means the mailbox doesn’t exist. It’s a permanent failure, usually a typo before the @ or a deleted account. Check the address rather than trying again.

The 550 is the server’s “no, and don’t retry” reply. It isn’t a sign of broken SPF or DKIM, so changing them won’t help.

What does “Mail delivery failed” or “Delivery Status Notification (Failure)” mean?

It’s a bounce: a mail system couldn’t deliver your message and is telling you why. The reason is in the error lines inside it, a three-digit reply code like 550 and a status code like 5.1.1.

A status code starting with 5 means the message failed for good as sent, so fix the problem before resending. One starting with 4 is temporary, and a later try may work. The usual ones:

  • 5.1.1: the mailbox doesn’t exist.
  • 5.1.2: the domain after the @ doesn’t exist or can’t take mail.
  • 5.7.1: a policy blocked the message. Ask the domain’s administrator.
  • 5.7.26: Gmail rejected it over authentication. The error text says which check failed: set up SPF or DKIM, or check the DMARC policy.

Why does my contact form email bounce?

The form’s reply may be going to an address that can’t receive mail: a typo, a made-up address, or a domain that doesn’t accept mail at all (a null MX). Another cause is a form that puts the visitor’s address in the From line, which can fail DMARC.

The bounce goes back to the message’s return address, which is often your own inbox. Two changes help:

  • Check the address when the form is sent. Reject one with no domain, or at a domain that can’t receive mail. A null MX is a single mail exchanger (MX) record whose target is a dot, and it means the domain accepts no mail.
  • Send from your own domain. Put the visitor’s address in Reply-To, not From.

Can someone send email pretending to be my domain?

Yes. Email doesn’t check the From address by default, so anyone can type your domain there. SPF, DKIM and a DMARC policy of quarantine or reject teach inboxes to distrust those fakes.

DMARC protects your exact domain, so it doesn’t stop a lookalike domain with one letter changed.

What are the Gmail and Yahoo bulk sender requirements?

Since February 2024, every sender to Gmail needs SPF or DKIM. If you send about 5,000 or more emails a day, you need SPF, DKIM and DMARC, one-click unsubscribe on marketing mail, and a spam rate under 0.3%. Yahoo’s rules are alike.

  • Everyone sending to Gmail: SPF or DKIM, valid forward and reverse DNS records, and a TLS (Transport Layer Security) connection.
  • Bulk senders to Gmail: SPF, DKIM and DMARC, with the From domain matching SPF or DKIM; one-click unsubscribe on marketing mail (password resets don’t count); and a spam rate below 0.3%, ideally below 0.10%.
  • Yahoo: SPF or DKIM at minimum. Bulk senders need both, a DMARC policy of at least p=none that passes, and complaints below 0.3%. Marketing mail needs one-click unsubscribe, honoured within two days.

Senders who already had unsubscribe links had until June 2024 to add one-click unsubscribe, and since November 2025 Gmail has enforced harder, so mail that doesn’t comply can be rejected, for a while or for good. The details are in Google’s sender guidelines FAQ and Yahoo’s sender best practices.

In what order should I fix this?

Check what’s already published. Fix SPF and DKIM, then add DMARC at p=none. Send a test from every service that sends as you, and read the reports for at least a week before tightening the policy.

If it all passes and mail still lands in spam, look at complaints and at who you send to.

AGNIZAR
Production AI · System architecture · Fractional CTO

Agnizar builds custom software and AI that fits the systems you already run, then hands it over or keeps it running. Every job starts small: one bounded piece of work, one named result, one clear decision. Tell us what you’re building; a senior engineer replies within a business day, not a salesperson.

Tell us what you’re building