Holt DevOps News

Clear Plesk Mail Queue

News Categories: Server Help

This article was published on: 05/10/16 3:48 AM

Clear Plesk Mail Queue

Clear Plesk Mail Queue via SSH Qmail or Roundcube

First lets check the number of messages from the queue using the qmail-qstat tool:

[root@yourserver /]# /var/qmail/bin/qmail-qstat
messages in queue: 52
messages in queue but not yet preprocessed: 2

We ALWAYS stop the mail server before making any changes or running clean up tools, to avoid having to reconfigure it again:

service qmail stop

Once the mail server service is stopped we are going to execute the following commands one by one:

find /var/qmail/queue/mess -type f -exec rm {} \;
find /var/qmail/queue/info -type f -exec rm {} \;
find /var/qmail/queue/local -type f -exec rm {} \;
find /var/qmail/queue/intd -type f -exec rm {} \;
find /var/qmail/queue/todo -type f -exec rm {} \;
find /var/qmail/queue/remote -type f -exec rm {} \;

Finally start the mail service and recheck the queue to ensure that all the messages have been removed:

service qmail start

To automate this process I have two scripts available (basically, are performing the same operations as above). For those that receive oversized file truncating errors please use the 2nd script – it takes a little longer but gets the job done.

wget https://dragos.fedorovici.com/qmailclear.sh
wget https://dragos.fedorovici.com/qmailclean.sh
sh qmailclean.sh
sh qmailclear.sh

Let's build a better web together

Get in touch with us for a quick quote

Web Development Agency, We Website Design

We’re eCommerce Experts in Cutting-edge Design & Development Technologies - Worldwide accreditation from leading digital platform providers including Shopify, WordPress & Magento.

Web Development Agency Manchester

Woolden Road
M44 5JX

Web Development Agency London

71-75 Shelton Street
Covent Garden

Let's hook up


0161 676 8989

Stalk Us On Social

What We Do

  • Shopify
  • WordPress
  • Magento
  • SEO
  • Aero Commerce
  • Shopify 2.0

Copyright 2022 We Agency - White Label Web Development Digital Agency.
Registered in England & Wales We Agency is a trading division of We Website Design Ltd. Company Registration Number 14175442 Privacy Policy

Ready to work with us?

Drop us your details and we will arrange a social distanced meet & greet or video chat so you can see our beautiful faces.