- First of all, check the current mail queue with the following command.
[arunlal@lintechops~]# /var/qmail/bin/qmail-qstat
messages in queue: 2458
messages in queue but not yet preprocessed: 18
2. In order to remove the mail queue. Stop the qmail service.
[arunlal@lintechops~]# service qmail stop
3. Once the service is stopped execute the following commands one by one
[arunlal@lintechops~]#find /var/qmail/queue/mess -type f -exec rm {} \;
[arunlal@lintechops~]#find /var/qmail/queue/info -type f -exec rm {} \;
[arunlal@lintechops~]#find /var/qmail/queue/local -type f -exec rm {} \;
[arunlal@lintechops~]#find /var/qmail/queue/intd -type f -exec rm {} \;
[arunlal@lintechops~]#find /var/qmail/queue/todo -type f -exec rm {} \;
[arunlal@lintechops~]#find /var/qmail/queue/remote -type f -exec rm {} \;
4. start the qmail service.
[arunlal@lintechops~] service qmail stop
Check the mail queue
[arunlal@lintechops~]# /var/qmail/bin/qmail-qstat
messages in queue: 0
messages in queue but not yet preprocessed: 0