You send a test email. It never arrives. You log into Plesk, open the mail queue, and find dozens — sometimes hundreds — of messages marked deferred or stuck with no status at all. Outgoing mail has silently stopped working. Clients are angry. The clock is ticking.
Plesk uses Postfix for mail delivery, and a stuck mail queue almost always has one of a handful of root causes: a blocked port 25, a misconfigured Amavis/SpamAssassin service, DNS resolution failure, or an IP blacklisting event. This guide walks you through diagnosing which one you're dealing with and applying the right fix — not just flushing the queue and hoping for the best.
Step 1: Read the Current Queue State
Before fixing anything, understand what you're dealing with.
Check the Queue via Plesk GUI
Navigate to Tools & Settings → Mail Server Settings → Mail Queue. Look at the Status column: deferred means Postfix tried and failed; active means currently being processed; messages with no status are frozen.
Check via Command Line (More Detail)
# Count queued messages
postqueue -p | tail -1
# Show full queue with error reasons
postqueue -p | head -100
# Show message count by status
mailq | grep -c "^[A-F0-9]"
The output of postqueue -p shows each queued message ID, its age, sender, recipient, and — critically — the delivery error reason on the next line. This error message is your primary diagnostic clue.
Read the Postfix Log for Recent Errors
tail -200 /var/log/maillog | grep "status=deferred\|Connection refused\|Timeout\|blacklisted"
On Debian/Ubuntu-based systems, the log path is /var/log/mail.log. On RHEL/CentOS, it's /var/log/maillog.
Common Cause 1: Port 25 Blocked by Firewall or ISP
The most common reason for a stuck queue on a freshly provisioned VPS or cloud server: port 25 is blocked by the hosting provider or upstream firewall.
Test outbound port 25 connectivity:
telnet smtp.gmail.com 25
Or:
nc -zv smtp.gmail.com 25
If the connection times out or is refused, port 25 is blocked. You'll see errors like Connection timed out or No route to host in the maillog.
Fix options:
- Contact your VPS/cloud provider to unblock port 25 (AWS, Google Cloud, Azure, and many VPS providers block it by default — you must submit a ticket).
- Use a Smart Host (SMTP relay): Configure Postfix to route all outgoing mail through an SMTP relay service (Mailgun, SendGrid, Amazon SES) that doesn't require direct port 25. In Plesk, go to Tools & Settings → Mail Server Settings → Relaying and enter your SMTP relay credentials.
Common Cause 2: Amavis or SpamAssassin Not Running
Plesk routes outgoing mail through Amavis (anti-virus/spam filter) before delivery. If Amavis is down, all messages queue on the Postfix side waiting for a service that never responds.
The error in maillog looks like:
connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Or after removing Plesk Email Security:
delivery temporarily suspended: connect to transport private/smtp-amavis: Connection refused
Check if Amavis is running:
systemctl status amavisd-new
# or on some systems:
service amavis status
Restart Amavis:
systemctl restart amavisd-new
systemctl restart postfix
If you removed Plesk Email Security and Amavis is no longer needed:
plesk sbin mchk --without-spam
This reconfigures Postfix to bypass the missing Amavis transport. Follow with:
systemctl restart postfix
Common Cause 3: DNS Resolution Failure
Postfix resolves recipient MX records for every outgoing message. If your server's DNS resolver is misconfigured or unreachable, every delivery attempt fails.
The maillog error looks like:
Host or domain name not found. Name service error for name=mail.example.com type=MX: Host not found, try again
Test DNS resolution from the server:
dig @8.8.8.8 MX gmail.com
nslookup -type=MX yahoo.com
If dig works with an explicit nameserver (@8.8.8.8) but not without it, your /etc/resolv.conf is pointing to a broken or unreachable resolver.
Fix:
# Check current resolvers
cat /etc/resolv.conf
# Temporarily add Google DNS
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 1.1.1.1" >> /etc/resolv.conf
For a permanent fix, update your network configuration (e.g., /etc/network/interfaces, /etc/sysconfig/network-scripts/ifcfg-eth0, or your cloud provider's VPC DNS settings).
Common Cause 4: IP Blacklisting
If your server's IP is listed on a DNS-based blackhole list (DNSBL), receiving mail servers will reject your messages and Postfix marks them deferred.
The maillog error looks like:
550 5.7.1 Service unavailable; Client host [1.2.3.4] blocked using zen.spamhaus.org
Check your IP against common blacklists:
SERVER_IP=$(curl -s ifconfig.me)
echo "Checking $SERVER_IP"
dig +short $SERVER_IP.zen.spamhaus.org
dig +short $SERVER_IP.bl.spamcop.net
dig +short $SERVER_IP.b.barracudacentral.org
Any non-empty result means your IP is listed on that blacklist.
Fix:
- Find and stop the spam source first — check
/var/log/maillogfor the sending account - Submit removal requests at the blacklist provider's portal (Spamhaus:
https://www.spamhaus.org/lookup/, SpamCop auto-expires, Barracuda:https://www.barracudacentral.org/lookups) - While waiting for delisting, consider using a smart host relay to route mail through a clean IP
How to Safely Clear or Flush the Queue
Once you've identified and fixed the root cause, process the queued messages.
Attempt Immediate Redelivery of All Deferred Messages
postqueue -f
This tells Postfix to flush all deferred messages — retry delivery immediately rather than waiting for the next scheduled retry interval.
Delete All Messages in the Queue (Nuclear Option)
Only do this if the queued messages are spam or you're certain none are legitimate:
postsuper -d ALL
Delete Only Deferred Messages
postsuper -d ALL deferred
Delete Messages from a Specific Sender
mailq | grep "^[A-F0-9]" | awk '$7 ~ /spammer@example.com/ {print $1}' | tr -d '*!' | postsuper -d -
Remove Corrupted Messages That Plesk GUI Won't Clear
Corrupt queue files don't respond to postsuper. Delete them directly from the filesystem:
# Find queue directories
ls /var/spool/postfix/
# Remove specific corrupt file (get ID from postqueue -p)
rm -f /var/spool/postfix/deferred/A/ABCDEF123456
rm -f /var/spool/postfix/defer/A/ABCDEF123456
postfix reload
Preventing Mail Queue Buildup
- Monitor queue size daily: Add a cron job that alerts you when the queue exceeds 50 messages —
postqueue -p | tail -1shows the count. - Enable Plesk's mail rate limiting: Go to Tools & Settings → Mail → Mail Server Settings and set per-domain hourly send limits to prevent a compromised account from flooding the queue.
- Keep Amavis and SpamAssassin updated: Outdated SpamAssassin rules cause false-positive spam scoring that defers legitimate mail.
- Check Plesk Email Security integration after updates: Plesk updates sometimes break the Amavis transport config — run
plesk repair mailafter any major Plesk upgrade.
If your Plesk mail queue issues are recurring or you need a managed solution for mail delivery, CloudHouse Technologies' server management team monitors and manages Plesk email infrastructure for hosting providers and businesses.
