Admin-Ahead Community
Linux => General Linux => Topic started by: arunlalp 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