Tuesday, May 24, 2011

How to rebuild qmail queue

This article is about how to rebuild qmail queue if it is damaged or consists of a lot of spam messages and wants to get rid of it.

Attention!
All current messages will be removed from the mail queue if you are following the steps below and cannot be restored the mails in the mail queue.


  • Stop qmail service 
[root@server~]# service qmail stop (or) /etc/init.d/qmail stop
  •  Then delete the folders under qmail queue and create the queue folder structure
[root@server~]# cd /var/qmail/queue
[root@server queue]# rm -rf info intd local mess remote todo
[root@server queue]# mkdir mess
[root@server queue]# for i in `seq 0 22`; do mkdir -p mess/$i; done;
[root@server queue]# cp -r mess info
[root@server queue]# cp -r mess intd
[root@server queue]# cp -r mess local
[root@server queue]# cp -r mess remote
[root@server queue]# cp -r mess todo
[root@server queue]# chmod -R 750 mess todo
[root@server queue]# chown -R qmailq:qmail mess todo intd
[root@server queue]# chmod -R 700 info intd local remote
[root@server queue]# chown -R qmails:qmail info local remote

  • Start the qmail service
service qmail start (or) /etc/init.d/qmail start

No comments:

Post a Comment