Script to check the email available in the qmail queue.
—————————————————————————

Use this script to find the emails available in the qmail queue.

#!/bin/bash
mails=`/var/qmail/bin/qmail-qstat |grep “messages in queue:”|awk ‘{print $4}’`
if [ $mails -gt 200 ]; then
SUBJECT=”Please check mail queue in RM7″
EMAIL=”USER@domain.com”
MESSAGE=”/tmp/message.txt”
echo “Please Check mail queue in RM7..It’s more than 750” > $MESSAGE
nomail=`/var/qmail/bin/qmail-qstat`
nom=`/var/qmail/bin/qmHandle -s`
echo $nomail >>$MESSAGE
echo $nom >>$MESSAGE
mail -s “$SUBJECT” “$EMAIL” < $MESSAGE
fi

2 thoughts on “Script to check the qmail queue”

Leave a Reply