Rebuilding Linux qmail-queue

Has your mail server been hit with a spam bot? Or maybe you’ve just made the catastrophic mistake of deleting directories in the qmail queue directory

All current messages will be removed from the mail queue if you are following the steps below and cannot be restored

Stop the qmail service

service qmail stop (or) /etc/init.d/qmail stop

Then delete the folders under qmail queue and create the queue folder structure

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
chmod -R qmailq:qmail mess todo intd
chmod -R 700 info intd local remote
chmod -R qmails:qmail info local remote

Start the qmail service

service qmail start (or) /etc/init.d/qmail start

Leave a Reply

Your email address will not be published. Required fields are marked *