Business Emails Going to Spam? How to Set Up SPF, DKIM and DMARC (Step by Step)

Quotes, invoices and order emails landing in Gmail spam or bouncing with a 5.7.26 error usually come down to three DNS records. This guide shows where to add SPF, DKIM and DMARC on Google Workspace or cPanel, and how to move DMARC to enforcement safely.

Published
Reading time
9 min
An abstract envelope passing through three violet rings, one broken, standing for SPF, DKIM and DMARC email checks

A customer says they never got your quote. Another finds your invoice three days late in their Gmail spam folder. A WooCommerce order confirmation bounces back with a line like “550-5.7.26 … the sender is unauthenticated.” When this happens, the cause usually sits in three small text records attached to your domain name: SPF, DKIM and DMARC.

This guide explains what those records do and where to add them if your email runs on Google Workspace or on cPanel hosting. It also covers how to switch DMARC on without blocking your own mail, and how to check your spam rate in Google Postmaster Tools. You do not need to be a developer. You need the login for wherever your domain’s settings are managed, and about an hour.

Why Gmail is hiding or rejecting your business email #

Gmail’s current rules for senders took effect on 1 February 2024. Google’s Email sender guidelines say every sender to Gmail accounts must set up SPF or DKIM, use valid forward and reverse DNS, send over an encrypted connection (TLS), keep the spam rate below 0.3% and not pretend to send from a Gmail address. Messages that fail authentication “might be marked as spam or rejected with a 5.7.26 error.”

Bulk senders, meaning anyone who sends more than 5,000 messages a day to personal Gmail accounts, must also have SPF, DKIM and DMARC together, an aligned From address and one-click unsubscribe on marketing mail. Google’s sender guidelines FAQ adds that bulk sender status “doesn’t have an expiration date”, so one large campaign can put you in that group for good.

Enforcement has firmed up since 2024. The same FAQ says: “Starting November 2025, Gmail is ramping up its enforcement on non-compliant traffic.” Failing mail now gets temporary errors (codes starting 4.7), permanent rejections (codes starting 5.7) or a trip to the spam folder.

First, Google’s FAQ says these guidelines apply to mail sent to personal Gmail accounts (@gmail.com and @googlemail.com), not to company inboxes on Google Workspace. Many of your customers will still be on personal Gmail. Second, the guidelines say Gmail “will begin using a DMARC quarantine enforcement policy” for its own gmail.com domain. If your website sends order emails “from” a [email protected] address, expect those emails to struggle.

SPF, DKIM and DMARC in plain English #

All three live in your domain’s DNS (Domain Name System), the public settings that tell the internet where your website and email are. Each one is a TXT record, a line of text published against your domain name or a sub-name of it.

  • SPF (Sender Policy Framework) is a list of the servers allowed to send email for your domain. A receiving server checks whether the message came from one of them.

  • DKIM (DomainKeys Identified Mail) is a digital signature added to each email. The matching public key sits in your DNS, so the receiver can confirm the message really came from you and was not changed on the way.

  • DMARC (Domain-based Message Authentication, Reporting and Conformance) tells receivers what to do when a message fails SPF and DKIM, and asks them to send you reports about who is sending as your domain.

DMARC also checks alignment, which means the domain in the visible From address must match the domain that passed SPF or DKIM. An invoice tool can pass SPF for its own domain and still fail DMARC for yours if it is not set up to sign as you. This is why emails sent by third-party tools often fail when your own mailbox works fine.

What the rules and numbers say #

The figures to work to, all from named sources:

  • Spam rate: Google asks senders to stay below 0.10% and “avoid ever reaching a spam rate of 0.30% or higher” (Gmail sender guidelines).

  • DKIM key length: at least 1024 bits, with 2048 bits recommended where your provider supports it (same source).

  • SPF lookups: an SPF check may make no more than 10 DNS lookups, under the SPF standard RFC 7208. Going over gives a permanent error, which DMARC treats as a fail. DMARC Report notes that Google’s include on its own uses 4 of the 10.

  • Timing: Google’s DMARC setup page says to “allow 48 hours after setting up SPF and/or DKIM before setting up DMARC.”

Step by step: fixing your records #

Step 1: Find where your DNS is managed #

Your records must go wherever your domain’s nameservers point. Nameservers are the servers that hold your DNS. If you add records anywhere else, nothing changes. Type your domain into the Google Admin Toolbox Dig tool, choose NS, and look at the answer.

If the nameservers belong to your web host, you will usually edit DNS in cPanel’s Zone Editor. If they say Cloudflare, edit in Cloudflare. If they belong to the company you bought the domain from, which is common for .ng and .com.ng domains bought through a local registrar, edit in that registrar’s dashboard.

Step 2: List every service that sends email as your domain #

Write down everything that sends mail with your domain in the From address. A typical list looks like this:

  • Your mailboxes, on Google Workspace or on your cPanel host.

  • Your website: WooCommerce order emails, contact form notifications, password resets.

  • A newsletter tool.

  • Accounting, invoicing, CRM or helpdesk software that emails customers in your name.

Each of these needs to pass SPF or DKIM with alignment. A business can “have DMARC set up” and still lose invoices because it missed one.

Step 3: Publish one SPF record #

For Google Workspace, Google’s SPF setup page gives this value, added as a TXT record on your root domain (the host is often written as @):

v=spf1 include:_spf.google.com ~all

Every other sender goes into the same line with its own include, which you will find in that service’s help pages. Google’s example for Workspace plus Mailchimp is v=spf1 include:_spf.google.com include:servers.mcsv.net ~all. If your website sends from your hosting server, add the server’s IP address as ip4: followed by the address. Google recommends ending with ~all (soft fail) rather than -all.

On cPanel email, go to Email, then Email Deliverability. As Namecheap’s guide to the tool describes, it lists each domain with its SPF, DKIM and DMARC status. Click Manage to see the suggested record, then “Install the suggested record”. The automatic button only works if your DNS is hosted on that server. If it is hosted elsewhere, copy the suggested value and add it by hand at your DNS provider.

Step 4: Turn on DKIM in Google Workspace #

  1. Sign in to the Google Admin console as an administrator.

  2. Go to Apps, then Google Workspace, then Gmail, then Authenticate email.

  3. Select your domain and click Generate new record. Choose 2048-bit unless your DNS provider cannot accept a long record.

  4. Copy the host name (usually google._domainkey) and the TXT value into your DNS.

  5. Wait for the record to spread, which DMARC Report puts at up to 48 hours, then return and click Start authentication.

Generating the record without clicking Start authentication leaves your mail unsigned.

Step 5: Turn on DKIM for cPanel mail and other senders #

In cPanel’s Email Deliverability page, the DKIM section works the same way as SPF: install the suggested record, or copy it to your external DNS. For newsletter, invoicing and CRM tools, look for a setting called “domain authentication” or “verify sending domain”. The tool will give you one or more CNAME or TXT records to add, and they make that tool sign mail as your domain.

For a WooCommerce shop, WooCommerce’s email troubleshooting guide says the plugin sends through WordPress’s own wp_mail() function on your host. It recommends a From address on your own domain and a dedicated SMTP provider. SMTP (Simple Mail Transfer Protocol) is the standard way email is handed from one server to another. An SMTP plugin can route order emails through Google Workspace or a transactional email service that you have authenticated, so they stop leaving from an unlisted web server.

Step 6: Publish DMARC in monitoring mode #

After SPF and DKIM have been live for 48 hours, add a TXT record with the host _dmarc (Google’s page writes the full name as _dmarc.example.com). Start with:

v=DMARC1; p=none; rua=mailto:[email protected]

Here p=none means “take no action, but report.” The rua address is where daily summary reports go; Google says the tag is optional but recommends always including it. Create a mailbox or group for these reports, because they arrive as XML files that are hard to read by eye. A DMARC report reader, free or paid, turns them into a list of who sent mail as your domain and whether each source passed.

Step 7: Test with a real email #

Send an invoice, a quote and a test order from each system to a personal Gmail address. Open each message, click the three-dot menu and choose Show original. You want to see SPF, DKIM and DMARC all marked PASS. If one fails, the header shows which domain was checked, which tells you which sender from Step 2 still needs work.

Step 8: Set up Google Postmaster Tools #

Postmaster Tools is Google’s free dashboard for senders. According to Google’s Postmaster Tools help, you add your domain, verify it with a TXT or CNAME record, and then see dashboards for spam rate, authentication and delivery errors. Google’s FAQ says a Compliance status dashboard also shows whether you meet each requirement and lists rejection codes.

Data only covers mail to personal Gmail accounts, and Google may hide figures when daily volume is low. A small business sending a few dozen invoices a day may see no data at all. That is normal, and the Show original test from Step 7 remains your best check. If you do see a spam rate, keep it under 0.1%.

Step 9: Move DMARC to enforcement #

Google advises starting at p=none and, “over time”, moving to quarantine (send failing mail to spam) or reject (refuse it). A safe sequence is:

  1. p=none, while you read reports and fix every legitimate sender.

  2. p=quarantine; pct=25, which applies the policy to a quarter of failing mail.

  3. p=quarantine; pct=100.

  4. p=reject, once reports show only spoofed mail failing.

DMARC Report suggests watching reports for at least a full quarter before enforcing. A business with only two or three senders may be ready sooner if every source passes for several weeks in a row. At quarantine or reject, DMARC also makes it harder for fraudsters to send fake invoices that appear to come from your domain.

Mistakes to avoid #

Two SPF records #

RFC 7208 allows one SPF record per domain. If a lookup finds two TXT records starting with v=spf1, the result is a permanent error and SPF fails for all your mail. This often happens when a new tool’s setup guide says “add this SPF record” and someone adds a second line instead of merging the include into the first.

A sender you forgot #

The website is the usual culprit. WooCommerce, contact forms and booking plugins often send from the web server, which may not be in your SPF record and does not sign with your DKIM key. Newsletter and invoicing tools that were never domain-authenticated are next. DMARC reports at p=none exist to catch these before you enforce.

Sending as a Gmail address from your website #

A From address like [email protected] on website or plugin emails cannot pass DMARC, because your web server is not authorised to send for gmail.com. WooCommerce’s own guide warns that Gmail or Yahoo From addresses are likely to land in spam or be blocked. Use an address on your own domain.

Going straight to p=reject #

Publishing p=reject on day one, before every sender passes, tells Gmail to refuse your own unauthenticated invoices. Start at p=none.

Going over 10 lookups #

Each include can trigger further lookups behind it. Stack five or six tools into one SPF record and you can pass the limit of 10 without noticing. Remove tools you no longer use, and rely on DKIM for services that offer it.

Editing the wrong DNS #

If your nameservers point to Cloudflare but you add records in cPanel’s Zone Editor, the records are never published. Check Step 1 again whenever a record “will not show up” after a day.

If your invoices or order emails are still landing in spam after these steps, Lumivor can audit your DNS, fix your sending setup and take your DMARC to enforcement for you.

Olamide Olaniyan

Written by

Olamide Olaniyan

Founder & Creative Lead. UI/UX designer, web developer & AI automation specialist

Olamide is a visionary entrepreneur and the driving force behind Lumivor Studio, a web design agency dedicated to crafting seamless digital experiences for businesses across corporate, SaaS, media, eCommerce, real estate, and non-profit sectors. With a rare blend of creativity, strategic insight,…

Work with us

Need a hand with your website?

We design, build and look after websites and web apps for businesses around the world. Tell us what you are working on.

Contact us
Scroll to Top