How to fix Qmail Queue?

For Linux server, sometimes the queue will having problem due to too many spam emails or bugs. For today, I had faced this issue and here I would like to share on how to fixed it.
Kindly note that you can recreate qmail's queue, but all current messages will be removed from the queue and cannot be restored.

How to fix Qmail queue?

1. Login to your server via SSH, ensure you login as root user
2. At the command prompt, stop the qmail services by typing 
/etc/init.d/qmail stop or qmailctl stop 

3. Then type the below command 
cd /var/qmail/queue  
rm -rf info intd local mess remote todo  
mkdir mess
for i in `seq 0 22`; 
do mkdir -p mess/$i  
done

cp -r mess info
cp -r mess intd  
cp -r mess local  
cp -r mess remote
cp -r mess todo

chmod -R 750 mess todo  
chown -R qmailq:qmail mess todo
chmod -R 700 info intd local remote
chown -R qmailq:qmail intd  
chown -R qmails:qmail info local remote

4. Start the qmail services


Comments