Here is the /etc/init.d/MailScanner script<br><br>#!/bin/bash<br>#<br># mailscanner This shell script takes care of starting and stopping<br># MailScanner, and its associated copies of sendmail.<br>#<br>### BEGIN INIT INFO
<br># Provides: MailScanner<br># Required-Start: $syslog $remote_fs<br># X-UnitedLinux-Should-Start: $time $network $named ypbind<br># Required-Stop:<br># X-UnitedLinux-Should-Stop:<br># Default-Start: 3 5
<br># Default-Stop: 0 1 2 6<br># Short-Description: MailScanner and sendmail daemons<br># Description: Start sendmail and MailScanner to provide<br># SMTP service with virus, dangerous contents and spam scanning.
<br>### END INIT INFO<br><br># Check for missing binaries (stale symlinks should not happen)<br>MAILSCANNER_BIN=/usr/sbin/check_MailScanner<br>test -x $MAILSCANNER_BIN || exit 5<br><br>#<br># Set the default values.<br>
# DON'T EDIT THESE, EDIT /etc/sysconfig/MailScanner INSTEAD!<br>#<br>MTA=sendmail<br>POSTFIX=/usr/sbin/postfix<br>POSTFIXINCF=/etc/postfix.in<br>POSTFIXOUTCF=/etc/postfix<br>POSTFIXWORKOWNER=postfix<br>POSTFIXQUAROWNER=postfix
<br>MAILSCANNER_WORKDIR="/var/spool/MailScanner/incoming"<br>MAILSCANNER_INQDIR="/var/spool/mqueue.in"<br>MAILSCANNER_RUNAS=root<br>SENDMAIL_IN_ARGS="-L sendmail-in -Am -bd -om"<br>SENDMAIL_CLIENT_ARGS="-L sendmail-client -Ac -q30m"
<br>SENDMAIL_OUT_ARGS="-L sendmail-out -Am -q30m -om"<br>SENDMAIL="/usr/sbin/sendmail"<br>RESTART_DELAY=10<br><br># Check for existence of needed config files and read them<br>test -s /etc/sysconfig/mail && \
<br> . /etc/sysconfig/mail<br><br>test -s /etc/sysconfig/sendmail && \<br> . /etc/sysconfig/sendmail<br><br>test -s /etc/sysconfig/MailScanner && \<br> . /etc/sysconfig/MailScanner<br><br><br>
msppid=/var/spool/clientmqueue/sm-client.pid<br>srvpid=/var/run/sendmail.pid<br>srvoutpid=/var/run/sendmail-out.pid<br>mspid=/var/run/MailScanner.pid<br><br>if test "$SMTPD_LISTEN_REMOTE" != "yes" ; then
<br> SENDMAIL_IN_ARGS="-O DaemonPortOptions=Addr=<a href="http://127.0.0.1">127.0.0.1</a> $SENDMAIL_IN_ARGS"<br>fi<br>if test "$MTA" = "sendmail" ; then<br> test -x $SENDMAIL || exit 5
<br>fi<br>SENDMAIL_IN_ARGS="-OPrivacyOptions=noetrn -ODeliveryMode=queueonly -OQueueDirectory=$MAILSCANNER_INQDIR -OPidFile=$srvpid $SENDMAIL_IN_ARGS"<br>SENDMAIL_CLIENT_ARGS="-OPidFile=$msppid $SENDMAIL_CLIENT_ARGS"
<br>SENDMAIL_OUT_ARGS="-OPidFile=$srvoutpid $SENDMAIL_OUT_ARGS"<br><br>StartInSendmail() {<br> echo -n "Initializing incoming $MTA"<br> if [ $MTA = 'postfix' ]; then<br> if test -x $POSTFIX ; then
<br> if [ -f $POSTFIXINCF/main.cf ]; then<br> $POSTFIX -c $POSTFIXINCF start 2> /dev/null<br> rc_status -v<br> fi<br> else<br> echo<br> echo "Assuming you are using a single Postfix instance (hold queue method)"
<br> fi<br> elif [ $MTA = 'sendmail' ]; then<br> startproc -p $srvpid $SENDMAIL $SENDMAIL_IN_ARGS<br> startproc -f -p $msppid $SENDMAIL $SENDMAIL_CLIENT_ARGS<br> rc_status -v
<br> elif [ $MTA = 'exim' ]; then<br> startproc -p $srvpid $EXIM -C $EXIMINCF -bd 2> /dev/null<br> rc_status -v<br> fi<br>}<br><br>StartOutSendmail() {<br> echo -n "Initializing outgoing $MTA"
<br> if [ $MTA = 'postfix' ]; then<br> if test -x $POSTFIX -a -f $POSTFIXOUTCF/main.cf ; then<br> $POSTFIX -c $POSTFIXOUTCF start 2> /dev/null<br> rc_status -v<br> else
<br> echo<br> echo "Error: Could not find Postfix installation, see /etc/sysconfig/MailScanner"<br> fi<br> elif [ $MTA = 'sendmail' ]; then<br> startproc -f -p $srvoutpid $SENDMAIL $SENDMAIL_OUT_ARGS
<br> rc_status<br> elif [ $MTA = 'exim' ]; then<br> startproc -p $srvpid $EXIM -C $EXIMOUTCF -bd 2> /dev/null<br> rc_status<br> fi<br> rc_status -v<br>}<br><br>. /etc/rc.status
<br>rc_reset<br>case "$1" in<br> startin)<br> StartInSendmail<br> ;;<br> startout)<br> StartOutSendmail<br> ;;<br> start)<br> StartInSendmail<br> StartOutSendmail
<br><br> echo -n "Initializing MailScanner"<br> if [ $MTA = 'postfix' ]; then<br> :> $mspid<br> chown $MAILSCANNER_RUNAS $mspid<br> chown $POSTFIXWORKOWNER $MAILSCANNER_WORKDIR
<br> #chown $POSTFIXQUAROWNER $MAILSCANNER_QUARDIR<br> fi<br> startproc -f -p $mspid /usr/sbin/check_MailScanner >/dev/null<br> # This didn't work as expected: rc_status -v<br> rm -f /var/lock/subsys/MailScanner.off >/dev/null 2>&1
<br> echo<br> ;;<br> stop)<br> echo -n "Shutting down $MTA and MailScanner"<br> if [ $MTA = 'postfix' ]; then<br> if [ -f $POSTFIXINCF/main.cf ]; then<br> $POSTFIX -c $POSTFIXINCF stop 2>/dev/null
<br> rc_status<br> fi<br> $POSTFIX -c $POSTFIXOUTCF stop 2>/dev/null<br> rc_status<br> elif [ $MTA = 'exim' ]; then<br> killproc -p $srvpid -TERM $EXIM<br> rc_status
<br> killproc -p $srvoutpid -TERM $EXIM<br> rc_status<br> elif [ $MTA = 'sendmail' ]; then<br> killproc -p $msppid -TERM $SENDMAIL<br> rc_status<br> killproc -p $srvpid -TERM $SENDMAIL
<br> rc_status<br> killproc -p $srvoutpid -TERM $SENDMAIL<br> rc_status<br> fi<br> # Patch courtesy of Peter Peters<br> killproc -p $mspid -TERM MailScanner<br> rc_status -v
<br> # Clear out all the old pid files<br> rm -f $mspid<br> # Clear out the old incoming dirs<br> cd $MAILSCANNER_WORKDIR && ls | egrep '^[0123456789]+$' | xargs /bin/rm -rf 2>/dev/null
<br> touch /var/lock/subsys/MailScanner.off >/dev/null 2>&1<br> ;;<br> try-restart)<br> $0 stop && sleep $RESTART_DELAY && $0 start<br> rc_status<br> ;;<br> restart)
<br> $0 stop<br> sleep $RESTART_DELAY<br> $0 start<br> rc_status<br> ;;<br> reload|force-reload)<br> echo -n "Reload service MailScanner"<br> killproc -p $mspid -HUP /usr/sbin/MailScanner
<br> rc_status -v<br> ;;<br> status)<br> echo -n "Checking for service MailScanner: "<br> if [ $MTA = 'postfix' ]; then<br> if [ -f $POSTFIXINCF/main.cf ]; then<br>
$POSTFIX -c $POSTFIXINCF status<br> fi<br> $POSTFIX -c $POSTFIXOUTCF status<br> elif [ $MTA = 'exim' ]; then<br> checkproc -p $srvpid $EXIM<br> rc_status<br> checkproc -p $srvoutpid $EXIM
<br> rc_status<br> elif [ $MTA = 'sendmail' ]; then<br> checkproc -p $msppid $SENDMAIL<br> rc_status<br> checkproc -p $srvpid $SENDMAIL<br> rc_status<br> checkproc -p $srvoutpid $SENDMAIL
<br> rc_status<br> fi<br> checkproc -p $mspid /usr/sbin/MailScanner<br> rc_status -v<br> ;;<br> probe)<br> test /etc/sendmail.cf -nt $srvpid -o /etc/mail/submit.cf -nt $msppid \
<br> -o /etc/MailScanner/MailScanner.conf -nt $mspid && echo reload<br> ;;<br> *)<br> echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe|startin|startout}"
<br> exit 1<br>esac<br>rc_exit<br><br><br><div><span class="gmail_quote">2007/3/9, Martin.Hepworth <<a href="mailto:martinh@solidstatelogic.com">martinh@solidstatelogic.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Steve<br><br>Well spotted - this must be an old version of MailScanner as recent ones<br>default to posix for sendmail MTAs.<br><br>--<br>Martin Hepworth<br>Snr Systems Administrator<br>Solid State Logic<br>Tel: +44 (0)1865 842300
<br><br>> -----Original Message-----<br>> From: <a href="mailto:mailscanner-bounces@lists.mailscanner.info">mailscanner-bounces@lists.mailscanner.info</a> [mailto:<a href="mailto:mailscanner-">mailscanner-</a><br>>
<a href="mailto:bounces@lists.mailscanner.info">bounces@lists.mailscanner.info</a>] On Behalf Of Steve Campbell<br>> Sent: 09 March 2007 15:08<br>> To: MailScanner discussion<br>> Subject: Re: MailSacanner don't work
<br>><br>><br>> ----- Original Message -----<br>> From: "Claudio Mundin" <<a href="mailto:clamun@gmail.com">clamun@gmail.com</a>><br>> To: "MailScanner discussion" <<a href="mailto:mailscanner@lists.mailscanner.info">
mailscanner@lists.mailscanner.info</a>><br>> Sent: Friday, March 09, 2007 5:08 AM<br>> Subject: Re: MailSacanner don't work<br>><br>><br>> > Mar 9 07:06:24 fw MailScanner[4156]: Using locktype = flock
<br>><br>> I'm not sure with this flavor of Linux, but you should probably set in<br>> your<br>> MailScanner.conf the following line:<br>><br>> Lock Type = posix<br>><br>> This isn't going to fix the problem you are seeing now, but might
<br>prevent<br>> other problems following the solution to what you are asking about.<br>I'm<br>> not<br>> sure if flock or posix is proper for Suse and sendmail.<br>><br>> Steve<br>><br>> ><br>
> ><br>><br>><br>> --<br>> MailScanner mailing list<br>> <a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.info</a><br>> <a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner">
http://lists.mailscanner.info/mailman/listinfo/mailscanner</a><br>><br>> Before posting, read <a href="http://wiki.mailscanner.info/posting">http://wiki.mailscanner.info/posting</a><br>><br>> Support MailScanner development - buy the book off the website!
<br><br><br><br><br>**********************************************************************<br>Confidentiality : This e-mail and any attachments are intended for the<br>addressee only and may be confidential. If they come to you in error
<br>you must take no action based on them, nor must you copy or show them<br>to anyone. Please advise the sender by replying to this e-mail<br>immediately and then delete the original from your computer.<br><br>Opinion : Any opinions expressed in this e-mail are entirely those of
<br>the author and unless specifically stated to the contrary, are not<br>necessarily those of the author's employer.<br><br>Security Warning : Internet e-mail is not necessarily a secure<br>communications medium and can be subject to data corruption. We advise
<br>that you consider this fact when e-mailing us.<br><br>Viruses : We have taken steps to ensure that this e-mail and any<br>attachments are free from known viruses but in keeping with good<br>computing practice, you should ensure that they are virus free.
<br><br>Red Lion 49 Ltd T/A Solid State Logic<br>Registered as a limited company in England and Wales<br>(Company No:5362730)<br>Registered Office: 25 Spring Hill Road, Begbroke, Oxford OX5 1RU,<br>United Kingdom<br>**********************************************************************
<br><br>--<br>MailScanner mailing list<br><a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.info</a><br><a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner">http://lists.mailscanner.info/mailman/listinfo/mailscanner
</a><br><br>Before posting, read <a href="http://wiki.mailscanner.info/posting">http://wiki.mailscanner.info/posting</a><br><br>Support MailScanner development - buy the book off the website!<br></blockquote></div><br>