Script for deleting all the mails in Qmail

1. create a file with the following statements, say delqmail

service qmail stop
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 {} \;
service qmail start

You may also include the directories like /var/qmail/queue/mess/bounce… etc.

2. Give executable permission to this file

chmod 755 delqmail

3. Execute the script

sh -x delqmail

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.