How to Fix cPanel Email Delivery Issues — SMTP Errors
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
- Misunderstanding that
Stringis[Char]with poor performance for large text operations - Using
foldlinstead offoldl'causing stack overflow on large lists - 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
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro