Sunday, August 16, 2015

Script to create mails alert in exim mail queue


#!/bin/bash
mailqueue=$(/usr/sbin/exim -bpc)
if [ "$mailqueue" -gt 2000 ]; then
 echo "Mails in Exim Queue: " $mailqueue | mail -s "EXIM MAIL QUEUE ALERT (server host name)" mailid
fi


Set in cron for every half an hour:

*/30 * * * * /usr/local/mailsalert/mailscheck.sh

No comments:

Post a Comment