Skip to content

How to Fix cPanel Email Delivery Issues — SMTP Errors

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix cPanel Email Delivery Issues. We cover key concepts, practical examples, and best practices.

The Problem

Emails are not being sent or received:

SMTP authentication failed.

or:

Email delivery delayed or failed.

Quick Fix

Step 1: Check email delivery status

cPanel > Email Deliverability

Review the status for your domain. Red status indicates DNS issues.

Step 2: Verify DNS records

Ensure these DNS records exist:

example.com.  MX  0  mail.example.com.
mail.example.com.  A  server-ip
example.com.  TXT  "v=spf1 ip4:server-ip ~all"

Step 3: Check the mail queue

# Exim mail queue:
exim -bp

# Flush the queue:
exim -q -v

# Remove a specific message:
exim -Mrm <message-id>

Step 4: Fix SMTP authentication

# Check that SMTP authentication is enabled:
cat /etc/exim.conf | grep auth

Ensure your email client uses:

  • Server: mail.example.com
  • Port: 587 (TLS) or 465 (SSL)
  • Authentication: PLAIN or LOGIN

Step 5: Check mail logs

tail -100 /var/log/exim_mainlog
tail -100 /var/log/exim_rejectlog

Step 6: Remove from spam blacklists

Check if your IP is blacklisted:

# Use MXToolbox or:
dig +short your-ip.zen.spamhaus.org

Request removal from the blacklisting service.

Prevention

  • Set up SPF, DKIM, and DMARC DNS records.
  • Monitor the mail queue daily.
  • Keep sending volumes reasonable to avoid rate limiting.

Common Mistakes with email delivery

  1. Misunderstanding that String is [Char] with poor performance for large text operations
  2. Using foldl instead of foldl' causing stack overflow on large lists
  3. Forgetting deriving (Show, Eq) on custom data types needed for debugging

These mistakes appear frequently in real-world CPANEL code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### What is the difference between SMTP and IMAP?

SMTP sends emails. IMAP receives and stores emails on the server. Both are needed for a complete email setup.

Why are my emails going to spam?

Missing or incorrect SPF/DKIM/DMARC records, poor sender reputation, or the email content triggers spam filters. Set up all three DNS records properly.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro