How to clear Qmail mail queue?
---------------------------------------NAME qmail-clean - clean up the queue directory SYNOPSIS qmail-clean DESCRIPTION qmail-clean reads a cleanup command from descriptor 0, per- forms the cleanup, prints the results to descriptor 1, and repeats.----------------------------------------
1. First of all check the number of messages from the queue using the qmail-qstat tool:
[root@CSSW2013NOC3 ~]# /var/qmail/bin/qmail-qstat2. To remove the messages from the queue ALWAYS stop the qmail service first, to avoid having to reconfigure it again:
messages in queue: 22463
messages in queue but not yet preprocessed: 22
[root@CSSW2013NOC3 ~]#service qmail stop3. Once the service is stopped execute the following commands one by one (based on the number of files stuck in the queue, this may take a while):
#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 {} \;4. Finally start the mail service and recheck the queue to ensure that all the messages have been removed:
[root@CSSW2013NOC3 ~]#service qmail startTo 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 http://dragos.fedorovici.com/qmailclear.sh
wget http://dragos.fedorovici.com/qmailclean.sh
[root@CSSW2013NOC3 ~]$sh qmailclean.sh
[root@CSSW2013NOC3 ~]#sh qmailclear.sh
Thank you for sharing this Information.
ReplyDeleteI also found Various useful links related to Devops, Docker & Kubernetes
Kubernetes Kubectl Commands CheatSheet
Introduction to Kubernetes Networking
Basic Concept of Kubernetes
Kubernetes Sheetsheat
Docker Basic Tutorial
Linux Sar Command Tutorial
Linux Interview Questions and Answers
Kubernetes Interview Question and Answers
Docker Interview Question and Answers
OpenStack Interview Questions and Answers