When email does not arrive, the problem is almost always one of five things: a wrong MX record, an invalid SPF, a broken DKIM, an aggressive DMARC, or an IP/domain on some blacklist. This guide takes you through each of them step by step, with concrete tools and commands you can run right away.
First step: find where the email gets stuck #
Email not arriving does not always mean the same thing. Three scenarios:
- We send email from our site/webmail, the recipient sees nothing (not even in spam). → Probably blocked or discarded on the recipient's server. Look at the authentication settings.
- We send email, the recipient finds it in spam. → A reputation problem (SPF/DKIM/DMARC wrong or a bad IP).
- We receive emails, ours go out fine, but a specific address does not reach us. → The problem is on the sender's side, not with us. Check the MX record.
Identifying the scenario before any work saves hours.
1. MX record: where you receive mail at all #
The MX (Mail Exchange) DNS record says where mail for your domain is received. The most common mistake: the domain points to the old hosting while you expect mail on the new one.
Check from the command line:
dig MX yourdomain.hr +short
or online: MXToolbox MX Lookup
You should see something like:
10 mail.yourdomain.hr.
20 backup-mail.provider.com.
The numbers (10, 20) are priorities: a lower number = a higher priority. If you see an MX that points to a server you no longer keep, mail goes nowhere. The fix: in the domain's DNS zone, set the MX to the correct hosting.
A typical MX record:
10 mail.yourdomain.hr.
with an A record for mail.yourdomain.hr pointing to the server's IP. If you have no mail subdomain, the MX can also point directly to the server's hostname.
2. SPF: who may send on behalf of your domain #
The SPF (Sender Policy Framework) TXT record says which IP addresses or servers may send mail from your domain. Without a correct SPF, mail ends up in spam or is rejected.
Check:
dig TXT yourdomain.hr +short | grep spf
You should see something like:
"v=spf1 +a +mx +ip4:185.x.x.x include:_spf.yourhosting.com ~all"
Main components:
v=spf1: the SPF version+a +mx: allow the domain's A and MX records to send+ip4:185.x.x.x: explicitly allow a specific IPinclude:_spf.yourhosting.com: include your hosting provider's SPF~all: "soft fail" for everyone else (recommended to start with;-allis the stricter "hard fail")
Typical SPF mistakes:
- Several SPF records for the same domain: the RFC allows only one. Merge them into one.
- More than 10 DNS lookups: SPF breaks. Optimise the includes.
- SPF allows only the hosting, but you also send from a CRM / newsletter: you must add their includes too (e.g.
include:_spf.mailchimp.com).
Validity check: MXToolbox SPF Record Check
3. DKIM: the cryptographic signature of an email #
DKIM (DomainKeys Identified Mail) adds a digital signature to the header of every outgoing email. The recipient checks through DNS that the signature matches the public key published in your domain: if it does, the email was not modified in transit.
Check:
dig TXT default._domainkey.yourdomain.hr +short
You should see a long TXT record that starts with v=DKIM1; k=rsa; p=... and continues with the public key (base64).
The selector ("default" above) can also be different, e.g. mail._domainkey, k1._domainkey, s1._domainkey. Your mail provider will tell you.
In cPanel at WMD:
- Go to Email Deliverability
- Find your domain in the list
- If SPF or DKIM are red/yellow, click Manage → Install the Suggested Record
- cPanel adds the correct DKIM record to DNS itself
If you host the domain on an external DNS (Cloudflare, Route53), cPanel will show you the record that you must copy manually into that DNS.
4. DMARC: the policy for what to do when SPF/DKIM fails #
DMARC (Domain-based Message Authentication, Reporting and Conformance) is a layer above SPF and DKIM. It tells the receiving mail server: "if an email passes neither the SPF nor the DKIM check, here is what to do: accept / put in spam / reject". Plus it enables sending reports about attempts to abuse your domain.
A minimal DMARC record to start with:
v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.hr;
Components:
p=none: "monitor mode". You do not delete any emails, you only collect reports. You always start here.rua=mailto:...the email to which they send you aggregate DMARC reports (XML format).- When you are sure that SPF and DKIM work for all legitimate emails, you switch to
p=quarantine(goes to spam), and eventuallyp=reject(reject).
The DMARC record goes on the _dmarc subdomain:
dig TXT _dmarc.yourdomain.hr +short
A typical mistake: setting p=reject right away without prior monitoring → legitimate emails (e.g. WP transactional from wordpress@yourdomain.hr) get rejected.
5. Blacklist checks #
Even when everything above works perfectly, mail can end up in spam because your IP or domain is on some blacklist. The reasons: a previously abused IP, a compromised site that sent spam, or a newsletter with a bad reputation.
Check these:
- MXToolbox Blacklist Check: check the server's IP against ~90 lists at once
- Spamhaus Lookup: the most important blacklist
- Microsoft Smart Network Data Services: Outlook/Hotmail-specific reputation
- Google Postmaster Tools: the Gmail reputation dashboard
What if you are on a list? Most lists have a self-service delisting form: you fill it in, they check, and they take you off. But if the reason (a compromised site, an infected WP) is not fixed, you will be back on the list within days.
A quick tool for everything at once #
If you want to test everything in one click:
- Mail Tester: you send a test email to their address, and see a score of 0-10 and the exact reason for each point deducted
- GMass SMTP Tester
- LearnDMARC: an interactive guide to DMARC implementation
Checklist for a new domain/email setup #
- The MX record points to the correct mail server (check
dig MX). - An SPF record exists, allows all systems that send on behalf of your domain, has ≤10 lookups.
- The DKIM key is set up and has passed validation (check through cPanel Email Deliverability).
- DMARC is set to
p=none+ rua for receiving reports. - The reverse DNS (PTR) of the mail server's IP matches the hostname.
- Send a test to Mail Tester: target 9.5+/10.
- Send a test email to your Gmail, Outlook, Yahoo: check that it arrives in the inbox, not spam.
- Over the next 2 weeks watch the DMARC reports, adjust SPF/DKIM for all legitimate senders.
- When it is 100% clean, switch DMARC to
p=quarantineorp=reject.
How WMD support helps with email problems #
On our hosting, SPF and DKIM are set up for every domain whose DNS is with us, and you enable DMARC with the „Set up” button in Reports in Moj WMD. If mail still goes to spam, send us the message header through the contact page and we will check.
Frequently asked questions #
Do I need DMARC if I have a small site without a newsletter?
Yes. Since February 2024 Gmail and Yahoo require DMARC for all bulk senders (5000+ messages a day), but even at a smaller volume DMARC protects your domain from spoofing. At least set p=none.
Can I set up SPF and DKIM if Cloudflare holds my DNS?
Of course. You copy all the TXT records that cPanel recommends into the Cloudflare DNS dashboard.
What if we send through both Gmail Workspace and the hosting?
SPF must include both: include:_spf.google.com + your hosting include. Otherwise one of the two systems will not pass validation.
How long does it take for DNS changes to take effect?
TTL decides: typically 5 min to 4 hours. The recipient mail servers' cache can hold old records for up to 24h.
Check your domain’s MX, SPF, DKIM and DMARC in one place with our DNS lookup.