Script for deleting all the mails in Qmail

create a file with the following statements, say frozen

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 frozen

3. Execute the script

sh frozen

Enjoy:)

    0 comments: