#!/bin/sh
#
# Mail queue processor.  Runs through the undelivered mail queue
# every SLEEPTIME seconds.
#
#TAG=OSI
SLEEPTIME=300

trap "" 1 15
while [ 1 ] ; do
	/usr/sbin/sendmail -q > /tmp/qerrs.$$ 2>&1
	if [ -s /tmp/qerrs.$$ ] ; then
		cat /tmp/qerrs.$$ | sed 's/^/mqueue: /p' | /usr/bin/logger -p mail.notice
	fi
	rm -f /tmp/qerrs.$$
	sleep ${SLEEPTIME}
done
