Back to tutorials
Tutorial

WHM Email Deliverability Tutorial (2026): Fix SPF, DKIM, DMARC, rDNS, and Exim Settings on cPanel

WHM email deliverability tutorial for 2026: fix SPF, DKIM, DMARC, rDNS, and Exim so your mail lands in inboxes.

By Anurag Singh
Updated on Oct 12, 2026
Category: Tutorial
Share article
WHM Email Deliverability Tutorial (2026): Fix SPF, DKIM, DMARC, rDNS, and Exim Settings on cPanel

Most “my emails go to spam” tickets aren’t caused by your newsletter tool. They usually come from small, fixable gaps in WHM. Common culprits include SPF/DKIM misalignment, incorrect rDNS, a hostname that doesn’t match HELO, or Exim behavior that looks abusive. This WHM email deliverability tutorial gives you a repeatable checklist to move domains from “risky” to “trusted” in 2026—without breaking customer mail flow.

You’ll tighten four layers:

  • DNS identity (SPF/DKIM/DMARC)
  • IP identity (rDNS + hostname)
  • TLS posture
  • Exim sending behavior

If you can, schedule a short maintenance window. Also drop DNS TTLs before you start.

What you’ll set up (and what you should collect first)

Collect a few details up front. It helps you avoid the “fixed one thing, broke another” loop.

  • Server IP(s): main outbound IPv4 and any dedicated IPs used for sending
  • Server hostname: in WHM → Networking Setup → Change Hostname
  • Domains affected: the From: domains customers send as (not just the server hostname)
  • Where DNS is hosted: WHM DNS cluster, Cloudflare, registrar DNS, etc.
  • Access: WHM root + ability to edit DNS zones

If you’re building or rebuilding your hosting stack, start with a clean outbound identity. A HostMyCode VPS gives you full control over WHM, DNS, and mail settings.

If you want the mail and security basics maintained consistently, managed VPS hosting is a better fit for production email.

Step 1: Verify hostname, rDNS, and HELO alignment (the fast win)

Deliverability starts with consistency. Many providers downgrade “generic” VPS hostnames. Mismatched reverse DNS is also an easy red flag.

1) Set a real hostname in WHM

Use a hostname like mail.yourdomain.com or server1.yourbrand.com. It must resolve to the server’s main IP.

  1. WHM → Networking Setup → Change Hostname
  2. Set: mail.yourdomain.com
  3. Save and let cPanel rebuild related config

2) Create forward DNS for the hostname

In the DNS zone for yourdomain.com, add:

  • mail A → <your-server-ip>
  • (Optional) mail AAAA → only if IPv6 is correctly configured for outbound mail

3) Set rDNS (PTR) to match the hostname

Point the IP’s PTR record to the same hostname you chose: mail.yourdomain.com. Set rDNS at your hosting provider, not inside WHM.

After the PTR change propagates, confirm from the shell:

dig +short A mail.yourdomain.com
# should return your server IP

dig +short -x <your-server-ip>
# should return mail.yourdomain.com.

If you want a deeper runbook for rDNS, follow this rDNS setup tutorial and come back here.

4) Ensure Exim HELO/EHLO uses the correct hostname

Exim typically uses the system hostname. If you see bounces like “Bad HELO”, stop and fix this first.

Use this companion guide for diagnosis and exact error mapping: SMTP HELO/EHLO hostname fix tutorial.

Step 2: Publish SPF the right way (no “+all”, no guesswork)

SPF answers one question: “Is this IP allowed to send mail for this domain?” If you publish the wrong SPF, you can create false fails. It can also make forwarding problems worse.

Pick the right SPF pattern

  • Simple single-server sending: authorize your server IP and end with -all (hard fail).
  • Multiple senders (Google Workspace, Microsoft 365, helpdesk): include their SPF plus your server IP.
  • Don’t exceed 10 DNS lookups: too many includes will cause permerror.

Example SPF record (single VPS IP)

Add a TXT record at the root of the domain (@):

v=spf1 ip4:<your-server-ip> a mx -all

Why this works: it allows the server IP, the A record of the domain, and the MX hosts. Then it hard-fails everything else.

Where to set SPF in cPanel/WHM

If your DNS is hosted on the same WHM server:

  1. WHM → Email → Email Authentication
  2. Select the domain, click Install/Repair for SPF

If DNS is external (Cloudflare/registrar), copy the SPF string from WHM and publish it there. Don’t publish two SPF TXT records. Merge them into one record.

Step 3: Enable DKIM signing per domain (alignment matters more than “having DKIM”)

DKIM proves message integrity and ties the message to a domain.

What providers care about most is alignment. The domain in the From header should match the domain used for DKIM signing (or be closely aligned).

Enable DKIM in WHM

  1. WHM → Email → Email Authentication
  2. For each sending domain, click Install/Repair under DKIM

That creates TXT records like:

default._domainkey.yourdomain.com TXT "v=DKIM1; k=rsa; p=..."

Quick verification (DNS + a real message)

First, confirm the DKIM TXT exists in public DNS:

dig +short TXT default._domainkey.yourdomain.com

Then send a test email to a mailbox you control (Gmail/Microsoft). View the “original message” headers. You want:

  • DKIM=pass
  • SPF=pass
  • DMARC=pass (after you set DMARC below)

If you need WHM-specific examples and common pitfalls (like broken zone templates or external DNS), see this SPF/DKIM/DMARC setup guide for WHM.

Step 4: Add DMARC with a safe rollout (monitor first, enforce later)

DMARC tells receivers what to do when SPF and DKIM don’t check out. It also tells them where to send reports.

Start in monitoring mode. Enforce only after you confirm alignment across real traffic.

Recommended DMARC policy progression

  1. Week 1: p=none (collect reports, fix misalignment)
  2. Week 2: p=quarantine with small percentage via pct=25
  3. Week 3+: increase pct, then consider p=reject

DMARC TXT record example (safe start)

Create a TXT record for _dmarc.yourdomain.com:

v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com; ruf=mailto:dmarc@yourdomain.com; fo=1; adkim=s; aspf=s

Notes:

  • adkim=s and aspf=s enforce strict alignment. If you have complex sending, start relaxed by removing them.
  • Make sure the dmarc@ mailbox is managed so it doesn’t fill disk. Forward it to a ticketing system, or filter it.

Step 5: Confirm TLS works cleanly for SMTP (and fix certificate traps)

Receivers increasingly score TLS quality and consistency. On cPanel, you want valid certificates on mail services. You also want reasonable protocol defaults.

Ensure mail services have valid certificates

In WHM:

  1. WHM → Manage Service SSL Certificates
  2. Check: Exim, Dovecot, cPanel/WHM services

If you use AutoSSL, keep it enabled. Fix any DNS issues blocking validation.

If you’re also untangling general HTTPS/TLS problems on the server, this guide covers renewals and common chain issues: SSL certificate setup guide.

Quick SMTP TLS test

From any Linux machine:

openssl s_client -starttls smtp -connect mail.yourdomain.com:587 -servername mail.yourdomain.com

You’re looking for a valid chain, the expected certificate CN/SAN, and no obvious verification errors.

Step 6: Tune Exim defaults for safer outbound sending (without breaking customers)

Identity is only half the story. Sending behavior also affects reputation.

One compromised account can dump thousands of messages quickly. That can poison your IP reputation.

Set outbound rate limits and alerts

In WHM, review:

  • WHM → Exim Configuration Manager → Basic Editor
  • WHM → Tweak Settings → mail-related limits

Exact options vary by cPanel build. The intent is consistent:

  • Limit messages per hour per domain/account to reduce burst spam.
  • Enable notifications when thresholds are hit.
  • Require SMTP authentication for submission (587) for users.

Diagnose the queue before you change too much

If mail is delayed or deferring, don’t “fix” it by raising concurrency. Find the root cause first. Then adjust.

Use this practical queue workflow: cPanel mail queue troubleshooting tutorial.

Common deliverability pitfalls in Exim on hosting servers

  • PHP mail() abuse: make sure you can attribute mail to a user, and restrict scripts that send without auth when appropriate.
  • Forwarders causing SPF breaks: encourage users to use IMAP + client rules, or implement SRS only if you truly need heavy forwarding flows.
  • Shared IP sending: one bad account can harm everyone. Consider dedicated IPs for high-volume customers.

Step 7: Validate with real-world tests (don’t trust one “pass” screenshot)

Run two types of checks: DNS correctness and real mail-path results.

DNS validation commands

# SPF
Dig +short TXT yourdomain.com | tr -d '"'

# DKIM (default selector)
dig +short TXT default._domainkey.yourdomain.com

# DMARC
dig +short TXT _dmarc.yourdomain.com

# rDNS
DIG +short -x <your-server-ip>

Mail-path checks you can do in minutes

  • Send to a Gmail address and use “Show original” to confirm SPF/DKIM/DMARC results.
  • Send to a Microsoft mailbox and check headers for Authentication-Results.
  • Confirm the visible From domain matches what’s being authenticated (alignment).

Step 8: Put guardrails in place (so you don’t fix this again next month)

Stable deliverability comes from operations, not one-time DNS edits.

Most hosting environments fail here. The usual issues are weak access controls, slow compromise response, and no routine verification.

Guardrail checklist for hosting VPS and reseller servers

  • Strong access controls: enforce 2FA in WHM/cPanel and reduce credential reuse.
  • Brute-force protection: lock down compromised mailboxes early.
  • Malware scanning: detect infected WordPress sites that send spam via PHP.
  • Backups + restore drills: fast recovery matters when you must rotate keys or rebuild.

Relevant hands-on follow-ups:

Practical “fix-it” scenarios (copy/paste runbook)

These patterns show up in day-to-day WHM operations. They’re especially common on multi-tenant VPS and reseller servers.

Scenario A: SPF passes, DKIM fails

  • Check default._domainkey TXT exists in the active DNS provider (not only in WHM).
  • Confirm the domain is actually being signed (some custom routing can bypass signing).
  • Repair DKIM in WHM Email Authentication, then re-check with dig.

Scenario B: DKIM passes, DMARC fails

  • DMARC fails most often due to alignment. The From domain and DKIM d= domain must align.
  • Avoid sending “From: yourdomain.com” while signing as a different domain unless you’ve designed for it.
  • Temporarily use p=none while you fix alignment across apps.

Scenario C: Everything passes, still landing in spam

  • Check content: link shorteners, suspicious attachments, and image-only emails get filtered even with perfect auth.
  • Check reputation: new IPs need warm-up. Avoid sudden volume spikes.
  • Check bounces/deferrals in Exim queue. A high deferral rate is a reputation signal.

Summary: your deliverability baseline for 2026

If you only fix five things, fix these: a real hostname, matching rDNS, a single clean SPF record, DKIM enabled for every sending domain, and a DMARC policy that starts in monitoring mode.

Then keep Exim predictable with rate limits, alerts, and quick queue triage.

For production email on cPanel, stable IP identity and predictable performance matter. Start with a HostMyCode VPS if you manage your own stack. Or move to managed VPS hosting if you want the mail and security foundations maintained alongside you.

If your WHM mail reputation keeps getting dragged down by shared outbound traffic, separate workloads and tighten sending policies. HostMyCode offers VPS plans that work well for reseller and small-business email, plus managed VPS hosting if you want help keeping deliverability controls and updates consistent.

FAQ

How long do SPF/DKIM/DMARC changes take to work?

DNS propagation depends on TTL. With a 300-second TTL, you’ll often see changes within 5–30 minutes, but some resolvers cache longer.

Should I use DMARC p=reject right away?

Not unless you’ve confirmed alignment for every system sending mail as the domain. Start with p=none, review results, then move to quarantine/reject.

Do I need a dedicated IP for good deliverability on WHM?

Not always, but it helps when you host many customers or any customer sends higher volume. Dedicated IPs reduce “neighbor” reputation damage.

What’s the quickest sign rDNS is wrong?

dig -x <ip> doesn’t return your mail hostname, or it returns a generic provider PTR. Many receivers downgrade trust in that case.

What if my DNS is on Cloudflare but mail is on WHM?

That’s fine. Just ensure SPF/DKIM/DMARC records are created in Cloudflare DNS (not only inside WHM), and avoid duplicate SPF TXT records.

WHM Email Deliverability Tutorial (2026): Fix SPF, DKIM, DMARC, rDNS, and Exim Settings on cPanel | HostMyCode