Hostxpeed
Login Get Started →
Server Management

How to Clear Mail Queue

3 min read
24 views
Jun 10, 2026

Prerequisites

Before clearing mail queue, make sure you have:

  • Postfix installed
  • Root or sudo privileges

Method 1: Flush the Queue (Try to Send All)

Connect to your VPS:

ssh hxroot@YOUR_SERVER_IP -p 22
sudo postqueue -f

Method 2: Delete All Messages from Queue

sudo postsuper -d ALL

Confirm by checking:

mailq

Method 3: Delete Specific Message by ID

Find message ID from mailq (first column):

sudo postsuper -d MESSAGE_ID

Method 4: Delete Only Deferred (Stuck) Messages

sudo postsuper -d ALL deferred

Method 5: Hold/Unhold All Messages

Hold:

sudo postsuper -h ALL

Unhold:

sudo postsuper -H ALL

Method 6: Move Messages to Another Queue (Debug)

sudo postsuper -r ALL

View Queue Count After Cleanup

mailq | wc -l

✅ Mail queue cleared. Check mail logs for reasons if queue was stuck.

Was this article helpful?