Emails going to spam — how to fix

12.03.2026
Complexity
min.

Summary

If emails from your server go to spam: configure SPF, DKIM, DMARC, PTR record, and check your IP against blacklists.

Applies to:
✔ VPS
✔ Dedicated servers
✔ Any mail server

Checklist

  1. PTR record is set and matches HELO
  2. SPF record contains server IP
  3. DKIM is configured and signature passes verification
  4. DMARC record is created
  5. IP address is not on blacklists

Setting up SPF

Add a TXT record for the domain:

v=spf1 ip4:SERVER_IP mx -all

Setting up DKIM

For Postfix, install opendkim:

apt install opendkim opendkim-tools -y
opendkim-genkey -s mail -d example.com -D /etc/opendkim/keys/

Add the public key as a TXT record for mail._domainkey.example.com.

Setting up DMARC

Add a TXT record for _dmarc.example.com:

v=DMARC1; p=none; rua=mailto:admin@example.com

Checking PTR

dig -x SERVER_IP +short

Checking IP against blacklists

dig +short 4.3.2.1.zen.spamhaus.org

If an IP is returned (e.g., 127.0.0.2), your address is blacklisted.

Checking email headers

Send a test email to Gmail. Open it, click "Show original". Check: SPF: PASS, DKIM: PASS, DMARC: PASS.

Verification

Send a test email to an external address. It should arrive in the Inbox, not Spam.

If your IP is on blacklists, submit a removal request. If emails keep going to spam after all configuration, open a support ticket.
Was this information helpful?
Yes   No
 
By continuing to use this website you will be agreeing to the website Acceptable Use Policy and the Use of Cookies while using the website and our services. Please also read our Privacy Policy under which, to the extent stated, you consent to the processing of your personal data.