I'm driven by a relentless pursuit of innovation, turning challenges into opportunities to create impactful solutions for humanity.

Phone

+8801 PROTECTED

Address

Dhaka, Bangladesh

Social Links

Web Development

How to Fix Emails Stuck in Postfix on CyberPanel: Step-by-Step Guide

Emails stuck in Postfix on CyberPanel are usually caused by misconfigured filters or HOLD rules. This guide shows a simple step-by-step way to fix it and get your emails sending again.

How to Fix Emails Stuck in Postfix on CyberPanel: Step-by-Step Guide

How to Fix Emails Stuck in Postfix on CyberPanel: Step-by-Step Guide

Emails stuck in the mail queue can be frustrating, especially when you rely on your server for sending transactional emails. If you’re using CyberPanel with Postfix and notice that all emails are stuck in the HOLD queue, this guide will help you troubleshoot and fix the issue step by step.

Step 1: Understand Why Emails Are Stuck

Before diving into commands, it’s important to understand why Postfix holds emails.

Postfix may place emails in the HOLD queue due to:

  • Content filters like SpamAssassin or Amavis not returning messages properly.
  • Incorrect Postfix configuration (like content_filter misconfiguration).
  • Header or body checks rules that force all messages into HOLD.

Checking the mail queue will help identify the issue:

postqueue -p

Emails with a ! at the end of the queue ID are in HOLD.

Step 2: Check Your Spam and Content Filter Settings

CyberPanel often installs SpamAssassin by default. Run these commands to check their status:

systemctl status spamassassin
systemctl status amavis

- If amavis is missing and content_filter is set to spamassassin, Postfix can’t process emails properly.

- In that case, you would either install Amavis or remove the content_filter from /etc/postfix/main.cf.

Check content_filter:

postconf | grep content_filter

If it’s empty, you are fine.

Step 3: Check for HOLD Rules in Postfix

Sometimes, emails are stuck because of Postfix header_checks or body_checks rules. To check:

postconf -n | grep header_checks

This will show the file Postfix uses to inspect email headers.

Step 4: Inspect header_checks File

Open the header_checks file:

cat /etc/postfix/header_checks

If you see a line like:

/^Received:/ HOLD

This is the root cause! Every email has a Received: header, so this rule forces all emails into HOLD.

Step 5: Fix the HOLD Rule

Edit the header_checks file:

nano /etc/postfix/header_checks

Comment out the line by adding # at the beginning:

#/^Received:/ HOLD

Save and exit (Ctrl+O → Enter → Ctrl+X).

Step 6: Apply the Changes

Run the following commands to update Postfix:

postmap /etc/postfix/header_checks
systemctl restart postfix

Step 7: Release All Held Emails

Finally, release emails from the HOLD queue:

postsuper -H ALL
postqueue -f

All previously held emails should now be sent immediately.

Step 8: Verify Your Setup

Check the mail queue again to ensure it’s empty:

postqueue -p

You should see no emails in HOLD. Test sending a new email to confirm that everything is working.

Tips to Avoid This Problem in the Future

  • Avoid generic HOLD rules like /^Received:/ HOLD. They catch all emails.
  • Use SpamAssassin or Rspamd properly with Amavis or mail filter integration.
  • Always check your Postfix configuration after installing plugins or changing email settings.
  • Keep logs handy:
     

    tail -f /var/log/maillog
    

Conclusion

Emails stuck in Postfix on CyberPanel are often caused by misconfigured filters or overly broad header rules. By carefully checking your configuration and removing unnecessary HOLD rules, you can restore normal email delivery. This step-by-step approach ensures that your server stays stable and emails are delivered reliably.

3 min read
Feb 14, 2026
By Mohit Hasan
Share

Leave a comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Related posts

Mar 29, 2026 • 3 min read
Introduction to CryptPHP: The Ultimate Tool for Protecting Your PHP Source Code

For PHP developers, protecting source code from unauthorized reverse engineering is a constant chall...

Jan 16, 2026 • 3 min read
Quartz + Spring Boot + PostgreSQL The Real Fix for “Bad value for type long : \\x”

I recently spent many painful hours debugging a Quartz Scheduler issue in Spring Boot with PostgreSQ...