Delete mail queue In Qmail
Appearance
Objective
Sometimes we get spam issue with Qmail. In that case thousands of mail will be in queue.
First stop qmail
vim /etc/inittab
SV:123456:respawn:/command/svscanboot
# out above line end of file
init q
For get help of qmHandle
qmHandle -h
To know which user account has been compromised. this command shows which user sending maximum mail.
qmHandle -l |grep From:|sort|uniq -c|sort -nr|head
Or can use below for same purpose
qmHandle -l|less
get message ID
qmHandle -m'message ID'|less
Please check in header file which user account compromised.
Change password for it first and delete mail in queue.
You can delete mail from queue using defference option to from qmHandle -h (help)
For example
qmHandle -h'Subject: limited offer'
above command will delete all messages in queue that have Subject: limited offer
Note:-> Please never apply above commands before stop qmail(mentioned above).