Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to clear qmail queue  (Read 7812 times)

0 Members and 1 Guest are viewing this topic.

arunlalp

  • Guest
How to clear qmail queue
« on: May 10, 2017, 04:47:36 am »
How to clear qmail queue
================================

1. First of all check the current mail queue with following command.

[root@testserver~]# /var/qmail/bin/qmail-qstat
messages in queue: 22463
messages in queue but not yet preprocessed: 22

2.In order to remove mail queue. Stop the qmail service.

[root@testserver~]# service qmail stop


3. Once the service is stopped execute the following commands one by one

[root@testserver~]#find /var/qmail/queue/mess -type f -exec rm {} \;
[root@testserver~]#find /var/qmail/queue/info -type f -exec rm {} \;
[root@testserver~]#find /var/qmail/queue/local -type f -exec rm {} \;
[root@testserver~]#find /var/qmail/queue/intd -type f -exec rm {} \;
[root@testserver~]#find /var/qmail/queue/todo -type f -exec rm {} \;
[root@testserver~]#find /var/qmail/queue/remote -type f -exec rm {} \;

4. start the qmail service.

[root@testserver~] [root@testserver~]

5. Check the mail queue

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