Help trying to install MailScanner 4.05-3 on SuSE 7.0
Julian Field
mailscanner at ecs.soton.ac.uk
Fri Nov 22 09:44:15 GMT 2002
Here is the RedHat init.d script. You will probably need to edit it a bit,
but it will show you most of what you need.
I'm going to do some work on the SuSE setup some time soon.
As for installing from source, MailScanner is written in Perl so you have
the source anyway.
At 21:19 21/11/2002, you wrote:
>I have just downloaded the 4.05-4 and 4.0.5-1 rpm's.
>The install.sh script complain sabout a missing rpm-build rpm file that is
>not in the 7 SuSE CDs, nor installed. No /usr/src/redhat or /usr/src/RPM tree
>here.
>So I am already on first square...:-((
>Where is that MailScanner daemon?
>The only other solution I envision is a certainly *clumsy * one:
>a) maintain two copies of sendmail.cf, one pointing to mqueue.in and the
>other pointing to mqueue.
>b) Use the first for the first run of sendmail, and the other for the second
>run...
>
>--
>MSc. Alberto García Fumero
>Centro de Información para la Educación
>Ministerio de Educación
>Usuario Linux No. 97 138
>¿Windows? No, gracias! No apruebo el IVA (Impuesto al Virus Agregado)
-------------- next part --------------
#!/bin/sh
#
# mailscanner This shell script takes care of starting and stopping
# MailScanner, and its associated copies of sendmail.
#
# chkconfig: 2345 80 30
# description: MailScanner is an open-source E-Mail Gateway Virus Scanner.
# processname: MailScanner
# config: /etc/MailScanner/MailScanner.conf
# pidfile: /var/run/MailScanner/MailScanner.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
QUEUETIME=15m
PIDDIR=/var/run/MailScanner
WORKDIR=/var/spool/MailScanner/incoming
INQDIR=/var/spool/mqueue.in
# Source mailscanner configureation.
if [ -f /etc/sysconfig/MailScanner ] ; then
. /etc/sysconfig/MailScanner
fi
export QUEUETIME
export PIDDIR
export WORKDIR
export INQDIR
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/check_MailScanner ] || exit 0
[ -f /usr/sbin/sendmail ] || exit 0
# Get a string of all the PIDs of MailScanner
#MailScannerPids() {
# cd $PIDDIR || return 1
# PIDLIST=`ls | grep '^MailScanner.' | sed -e 's/MailScanner.//g'`
# echo PIDLIST
# return 0
#}
# Start both the sendmail processes
StartInSendmail() {
/usr/bin/newaliases > /dev/null 2>&1
if test -x /usr/bin/make -a -f /etc/mail/Makefile ; then
make -C /etc/mail -q
else
for i in virtusertable access domaintable mailertable ; do
if [ -f /etc/mail/$i ] ; then
makemap hash /etc/mail/$i < /etc/mail/$i
fi
done
fi
/usr/sbin/sendmail -bd -ODeliveryMode=queueonly \
-OQueueDirectory=$INQDIR
success
echo
}
StartOutSendmail() {
/usr/sbin/sendmail $([ -n "$QUEUETIME" ] && echo -q$QUEUETIME)
success
echo
}
RETVAL=0
# See how we were called.
case "$1" in
start)
# Start daemons.
echo 'Starting MailScanner daemons:'
echo -n ' incoming sendmail: '
StartInSendmail
echo -n ' outgoing sendmail: '
StartOutSendmail
echo -n ' MailScanner: '
/usr/sbin/check_MailScanner >/dev/null
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/MailScanner
success
echo
;;
stop)
# Stop daemons.
echo 'Shutting down MailScanner daemons:'
echo -n ' MailScanner: '
killproc MailScanner
echo
echo -n ' incoming sendmail: '
killproc sendmail 2>/dev/null
echo
echo -n ' outgoing sendmail: '
killproc /usr/sbin/sendmail 2>/dev/null
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/MailScanner
# Clear out all the old pid files
#[ -f /var/run/MailScanner/MailScanner.* ] && \
rm -f /var/run/MailScanner/MailScanner.*
# Clear out the old incoming dirs
cd $WORKDIR && ls | xargs /bin/rm -rf
;;
status)
# Work out if all of MailScanner is running
echo 'Checking MailScanner daemons:'
echo -n ' MailScanner: '
pid=`pidofproc MailScanner`
if [ -z "$pid" ] ; then failure; else success; fi
echo
# Now the incoming sendmail
echo -n ' incoming sendmail: '
pid=`ps ax | grep 'sendmai[l]: accepting connections'`
if [ -z "$pid" ] ; then failure; else success; fi
echo
# Now the outgoing sendmail
echo -n ' outgoing sendmail: '
# More complex regexp to handle other RedHats
pid=`ps ax | egrep '\[sendmail\]|sendmai[l] -q[0-9]*[mhd]'`
if [ -z "$pid" ] ; then failure; else success; fi
echo
;;
restart)
$0 stop
sleep 2
$0 start
RETVAL=$?
;;
reload)
echo -n 'Reloading MailScanner: '
pid=`pidofproc MailScanner`
if [ -z "$pid" ] ; then failure; echo
else success; echo; kill -HUP $pid; fi
;;
*)
echo "Usage: service MailScanner {start|stop|status|restart|reload}"
exit 1
esac
exit $RETVAL
-------------- next part --------------
--
Julian Field Teaching Systems Manager
jkf at ecs.soton.ac.uk Dept. of Electronics & Computer Science
Tel. 023 8059 2817 University of Southampton
Southampton SO17 1BJ
More information about the MailScanner
mailing list