PDA

View Full Version : Script for lunch qmail-scanner


daviweb
06-09-2004, 01:26 PM
I installed Clam Antivirus, SpamAssassin e qmail-scanner following the guide Part 14 and Part 15.

All ok! :o

But when i try to "instruct Qmail to use Qmail-Scanner as the alternative queuing mechanism" i have a problem! I haven't the directory supervise/qmail-smtpd/run! I doesn't do it because i followed another guide... :roll:

Then my question is: How can i lunch qmail-scanner using this file to startup/shutdown qmail?


#!/bin/sh

# script di avvio per qmail

#
#ulimit -v 32768
PATH=/usr/local/bin:/var/qmail/bin:$PATH



[ -f /var/qmail/bin/qmail-smtpd ] || exit 0



RETVAL=0

prog="qmail"

hostname="test.it"



start() {

# Start daemons.

echo -n $"Starting $prog: "



QMAILDUID=`id -u qmaild`

NOFILESGID=`id -g qmaild`

csh -cf '/var/qmail/rc &'

/usr/local/bin/tcpserver -H -R -x /etc/tcp.smtp.cdb -u$QMAILDUID -g$NOFILESGID 0 smtp /var/qmail/bin/qmail-smtpd & >/d
ev/null 2>&1

/usr/local/bin/tcpserver -v -H -l$hostname -R 0 pop3 /var/qmail/bin/qmail-popup $hostname /home/vpopmail/bin/vchkpw /v
ar/qmail/bin/qmail-pop3d \
Maildir 2>&1 | /var/qmail/bin/splogger pop3d &



echo -n "qmail "
RETVAL=$?

echo

[ $RETVAL -eq 0 ] && touch /var/lock/subsys/svscan

return $RETVAL

}



stop() {

# Stop daemons.

echo -n $"Shutting down $prog: "

killall qmail-send

killall /usr/local/bin/tcpserver

RETVAL=$?

echo

[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/svscan

return $RETVAL

}



# See how we were called.

case "$1" in

start)

start

;;

stop)

stop

;;

restart|reload)

stop

start

RETVAL=$?

;;

*)

echo $"Usage: $0 {start|stop|restart}"

exit 1

esac



exit $RETVAL


Thanks to all!