sendmail_check for Ensim w/ MailScanner

Lists Only - Daron lists at DILLONST.COM
Fri Dec 13 01:05:29 GMT 2002


Here is Julian's fix:


/usr/local/sbin/check_sendmail
---------------START CODE------------------------
#!/bin/bash
# Developed By: Julian Field <mailscanner at ecs.soton.ac.uk>
www.MailScanner.info
# Distributed By: Daron Roberts <admin at go2webs.com> www.Go2Webs.com
# File Path/Name: /usr/local/sbin/check_sendmail
# Free to Distibute with full headers attached.
#
# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

QUEUETIME=15m

# Source mailscanner configureation.
if [ -f /etc/sysconfig/MailScanner ] ; then
        . /etc/sysconfig/MailScanner
fi
export QUEUETIME

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/sendmail ] || exit 0

# Work out the process id of the outgoing sendmail
# so we can check it is still alive.
pid=`ps ax | egrep '\[sendmail\]|sendmai[l] -q[0-9]*[mhd]|sendmail:
Queue runner'`
if [ -z "$pid" ] ; then
echo Starting outgoing sendmail.
logger -p mail.crit -t check_sendmail Restarting outgoing
sendmail...
/usr/sbin/sendmail $([ -n "$QUEUETIME" ] && echo -q$QUEUETIME)
else
logger -p mail.info -t check_sendmail Outgoing sendmail working
okay.
#echo Outgoing sendmail still running.
fi
---------------END CODE---------------------------


/etc/cron.d/sendmail_check
--------START CODE-------------------------
MAILTO=root
SHELL=/bin/bash
*/5 * * * * root /usr/local/sbin/check_sendmail

-------END CODE--------------------------------



More information about the MailScanner mailing list