Web hosting, VPS hosting and dedicated servers built for websites, apps and online businesses.
CybroHost Client Area
CybroHost
Browse by Topic All Blogs Business & Marketing Hosting & Servers Security & Performance Tutorials Website & WordPress Tips
CybroHost Blog

How to Fix a Stuck Email Queue on a Linux SMTP Server

Learn how to fix a stuck email queue on a Linux SMTP server. Check Postfix and Exim queues, read delivery errors, repair DNS or port 25 issues, and retry safely without deleting legitimate messages.

By October 22, 2026 3 min read Tutorials
Stuck email queue on a Linux SMTP server with Postfix and Exim troubleshooting.

A stuck email queue on a Linux SMTP server can delay password resets, order updates, and other important messages. Some delays are normal because mail servers retry temporary failures. However, a growing queue needs attention. Follow these steps to find the cause and restore delivery safely.

Stuck Email Queue: Why Does It Happen?

Common causes include blocked outbound port 25, DNS failures, full disks, and receiving-server rate limits. Incorrect mail routing or temporary recipient errors can also hold messages. Before retrying everything, identify which problem appears in your logs.

Step 1: Check the Mail Queue

First, connect to your VPS over SSH. Then use the command that matches your mail server.

Postfix:

sudo postqueue -p

Exim:

sudo exim -bp

Look for message IDs, recipient addresses, queue age, and deferred-delivery reasons. A few delayed messages are not necessarily a fault. A queue that keeps growing is more concerning.

Step 2: Read the Delivery Errors

For Postfix, inspect the queued message and recent logs:

sudo postcat -q QUEUE_ID
sudo journalctl -u postfix -n 50 --no-pager

Some installations record SMTP details in /var/log/mail.log or /var/log/maillog instead. For Exim, inspect a message’s delivery log:

sudo exim -Mvl MESSAGE_ID

Replace the sample ID with a real queue ID. 4xx SMTP replies usually indicate temporary problems. 5xx replies generally mean a permanent rejection. Also watch for connection timeouts, DNS lookup failures, and disk errors.

Step 3: Fix the Underlying Problem

Check the relevant failure before changing settings:

  • Network: Verify outbound port 25 and the provider’s firewall rules.
  • DNS: Confirm that recipient MX records resolve correctly.
  • Server health: Check free disk space with df -h and verify your mail service is running.
  • Reputation: Review PTR/rDNS, SPF, DKIM, DMARC, and recipient rejection messages.
  • Sending limits: Slow down if a receiving provider requests fewer connections.

If you manage your own mail stack, CybroHost SMTP VPS Hosting provides port 25 access and PTR/rDNS control. You still need to maintain secure software and responsible sending practices.

Step 4: Retry Delivery Carefully

After you correct the problem, ask Postfix to retry its queue:

sudo postqueue -f

For Exim, start a queue run:

sudo exim -q

The official Postfix queue manual warns against frequent queue flushing. Repeated retries can overload a server or worsen recipient throttling. Check the queue again after a reasonable interval rather than running these commands continuously.

Step 5: Prevent Another Queue Backup

Monitor queue size, SMTP errors, storage, and unusual sending spikes. Secure account credentials, remove invalid recipients from permission-based lists, and fix misconfigured applications. Never delete the entire queue blindly: it may contain legitimate messages that you cannot recover.

FAQs

Does restarting Postfix clear the queue?

No. Postfix normally keeps queued messages on disk when its service restarts. Restarting alone rarely fixes a delivery problem.

Why are emails deferred when port 25 is open?

DNS errors, recipient rate limits, server reputation, and remote outages can still delay mail. Read the delivery response first.

Should I delete all stuck emails?

No. Remove only messages you have confirmed are unwanted, and preserve evidence before making destructive changes.

Final Recommendation

Inspect the queue, read delivery errors, correct the cause, and retry carefully. Good monitoring prevents minor delays from becoming major mail backlogs.

Ethan Collins

CybroHost editorial team sharing hosting, VPS, security, and performance knowledge.