When mail from your domain lands in spam, the receiving provider has decided it cannot trust where the message came from, or does not trust the sender's history. The first part is fixable in DNS in under an hour: publish SPF, turn on DKIM signing and add a DMARC record. Gmail and Outlook now require these for anyone sending in volume, and they help every sender. This guide explains the causes, gives example records you can adapt, and shows how to check the result.
Why your email goes to spam: the usual causes
| Cause | How to spot it | Fix |
|---|---|---|
| No SPF record, or one that leaves out a sender | Headers show spf=none, softfail or fail | Publish one SPF record listing every service that sends for you |
| Mail is not DKIM-signed with your domain | dkim=none, or signed only by the provider's own domain | Turn on DKIM in your mail service and publish its key |
| No DMARC record | dmarc=none, or a "no DMARC" warning in testers | Add a DMARC record, starting at p=none |
| SPF or DKIM pass, but for a different domain than the From address | dmarc=fail although SPF or DKIM shows pass | Use a custom DKIM domain or a custom bounce domain so they align |
Website sends with PHP mail() from the web server | Received headers show your web server's IP and no DKIM | Send through a mail service on port 587 with authentication |
| Server IP has no reverse DNS (PTR) or is on a blocklist | Bounces mention PTR, rDNS or a blocklist name | Set PTR, or relay through a mail service instead |
| Recipients mark your mail as spam | High spam rate in Google Postmaster Tools | Mail only people who asked, add one-click unsubscribe |
The first four rows are DNS. The rest are about how and to whom you send. Fix the DNS first, because everything else is judged after it.
Step 1: list everything that sends mail as your domain
Before writing records, make a list. Typical senders are your mailbox provider, your website or app (contact forms, password resets, invoices), a newsletter or marketing tool, a helpdesk, a billing system and sometimes a CRM. Each needs to be covered by SPF or DKIM, ideally both. Anything you forget will fail once DMARC is enforced, so the list matters more than the syntax.
Step 2: publish one SPF record
SPF (Sender Policy Framework, RFC 7208) is a TXT record on your domain listing which servers may send mail for it. Each sending service tells you what to include. A domain that uses one mail provider and one newsletter tool might publish:
example.com. 3600 IN TXT "v=spf1 include:_spf.mailprovider.example include:spf.newsletter.example ~all"
If you also send directly from your own server, add its address with ip4:203.0.113.10. Three rules catch most people out:
- One SPF record only. RFC 7208 treats two
v=spf1records on the same name as a permanent error, so SPF fails for all mail. Merge them into one. - No more than 10 DNS lookups. Each
include,a,mx,ptr,existsandredirectcosts a lookup, and nested includes count too. Over 10 is also a permanent error. Remove services you no longer use. - End with
~allor-all, never+all, which lets anyone send as you.~all(softfail) is the safe start; DMARC will decide what happens to failures.
SPF checks the envelope sender (the bounce address), not the From address people see. That is why DKIM and DMARC are needed as well.
Step 3: turn on DKIM signing
DKIM (DomainKeys Identified Mail, RFC 6376) adds a digital signature to each message. Your mail service signs with a private key and you publish the public key in DNS under a selector name it gives you:
s1._domainkey.example.com. 3600 IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
Some services ask for a CNAME instead, pointing your selector at a key they host and rotate; publish exactly what they show. Use a 2048-bit key where the service offers it. Google's sender guidelines require a key of 1024 bits or longer for any mail to personal Gmail accounts and recommend 2048 bits. A long key may need to be split into several quoted strings in one TXT record; most DNS panels do this for you.
The important setting is that the signature uses your domain (d=example.com), not the service's. Many tools sign with their own domain until you add the records and switch on "custom domain" or "authenticate domain".
Step 4: add a DMARC record
DMARC ties the two together. It passes when SPF or DKIM passes and the domain that passed matches the From address, and it tells receivers what to do when neither does. It lives at _dmarc on your domain:
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"
- Start with
p=none. Nothing is blocked; receivers send aggregate reports to theruaaddress showing which IPs sent as your domain and whether they passed. - Read the reports for two to four weeks. Fix any real sender that fails, usually a tool missing from SPF or without DKIM on your domain.
- Move to
p=quarantine, which asks receivers to put failing mail in spam. - Then
p=rejectonce you are confident, so forged mail claiming to be you is refused outright.
DMARC was revised in May 2026: RFC 9989 replaced RFC 7489 and dropped the old pct= tag, so do not rely on a percentage rollout; a t=y (testing) flag replaces part of what it did. The none, quarantine and reject policies are unchanged.
What Gmail and Outlook require from senders
| Provider | Applies to | Authentication | Other rules |
|---|---|---|---|
| Gmail, all senders | Anyone sending to Gmail accounts | SPF or DKIM | Valid forward and reverse DNS for sending IPs, TLS, spam rate in Postmaster Tools below 0.3%, DKIM key 1024 bits or longer |
| Gmail, bulk senders | About 5,000 or more messages a day to Gmail | SPF and DKIM, plus DMARC (p=none allowed) aligned with the From domain | One-click unsubscribe and a visible unsubscribe link on marketing mail |
| Outlook.com high-volume senders | Domains sending over 5,000 emails a day | SPF, DKIM and DMARC of at least p=none, aligned with SPF or DKIM | Non-compliant mail goes to Junk from May 2025; Microsoft says rejection (error 550 5.7.515) will follow on a date it will announce |
If you send far less than this, the rules still describe what filters reward. A small business with all three records in place is in a better position than one relying on luck.
Test your setup
- Check the records exist. From any Linux or macOS terminal:
On Windows,dig example.com TXT +short dig s1._domainkey.example.com TXT +short dig _dmarc.example.com TXT +shortnslookup -type=TXT _dmarc.example.comdoes the same. New records can take time to appear everywhere; see DNS propagation time. - Send yourself a test and read the headers. In Gmail, open the message, choose "Show original" and look for SPF, DKIM and DMARC each marked PASS. The
Authentication-Resultsheader shows the same in any mail client. - Use a checker. Third-party tools such as MXToolbox and mail-tester score your records and a sample message. Treat their scores as hints; the receiving provider's own verdict in the headers is what counts.
- Watch reputation over time. Google Postmaster Tools shows your spam rate and authentication results for mail to Gmail once you verify the domain.
If you send from your own VPS
Most websites and apps should hand mail to a mail service on port 587 rather than deliver it themselves; our SMTP guide explains why, and email port numbers lists the ports. If you do run a mail server on a VPS, you need all three records above plus a PTR (reverse DNS) record for the server's IP that names a hostname resolving back to the same IP, and a new IP has no sending history, so start with low volumes. On our VPS and dedicated servers outbound port 25 is closed by default and opened on request; why port 25 is closed explains the process.
When everything passes but mail still goes to spam
- Check the content. Link shorteners, image-only messages, a mismatch between link text and the real URL, and attachments from unknown senders all count against you.
- Check who you mail. Bought or old lists produce bounces and spam complaints, which hurt more than any missing record.
- Keep sending steady. A sudden jump from a few messages to thousands looks like a compromised account.
- Ask recipients to mark you "Not spam" and to add you to their contacts; it helps that mailbox and feeds the provider's signals.
On Bigdomainhost servers
We do not sell standalone email hosting or an SMTP relay. If you need mailboxes on your website's domain, our Web and cPanel hosting plans include them, with SPF, DKIM and DMARC set up by default; otherwise keep using your current mail provider and publish the records it gives you. If your website or application runs on our VPS or dedicated servers, we will help you check SPF, DKIM, DMARC and PTR and read any bounce. Phone support is in IST working hours and WhatsApp is answered at any time on +91 75994 50220. For the DNS basics, see What is DNS?
This guide was written by the Bigdomainhost team with AI assistance. Record formats were checked against RFC 7208, RFC 6376 and RFC 9989, and sender rules against Google's and Microsoft's published guidance, on 1 December 2026.
Sources (checked )
- RFC Editor: RFC 7208: Sender Policy Framework (SPF)
- RFC Editor: RFC 6376: DomainKeys Identified Mail (DKIM) Signatures
- RFC Editor: RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC)
- Google Workspace Admin Help: Email sender guidelines
- Microsoft Tech Community: Outlook's new requirements for high-volume senders