3 # /etc/init.d/qmail : start or stop the qmail mail subsystem.
5 # Written by Christian Hudon <chrish@debian.org>
12 # set default delivery method
14 alias_empty
="|/usr/sbin/qmail-procmail" # procmail delivery to /var/spool/mail
15 #alias_empty="./Maildir/" # This uses qmail prefered ~/Maildir/ directory
16 #alias_empty="./Mailbox" # This uses Mailbox file in users $HOME
18 logger
="splogger qmail"
19 #logger="|accustamp >>/var/log/qmail.log" # If you have accustamp installed.
20 #logger=">>/var/log/qmail.log" # Does not give timing info.
22 # If you uncommented one of the lines that appends to /var/log/qmail.log, you
23 # need to uncomment the following two lines.
24 #touch /var/log/qmail.log
25 #chown qmaill /var/log/qmail.log
28 # End of configuration
31 test -x
/usr
/sbin
/qmail-start ||
exit 0
32 test -x
/usr
/sbin
/qmail-send ||
exit 0
36 echo -n
"Starting mail-transfer agent: qmail"
37 sh
-c
"start-stop-daemon --start --quiet \
38 --exec /usr/sbin/qmail-send \
39 --startas /usr/sbin/qmail-start -- \"$alias_empty\" $logger &"
43 echo -n
"Stopping mail-transfer agent: qmail"
44 if [ "`pidof /usr/sbin/qmail-send`" ] ; then
45 start-stop-daemon
--stop
--quiet
--oknodo
--exec /usr
/sbin
/qmail-send
47 # Wait until the timeout for qmail processes to die.
50 while ([ $count != 0 ]) do
52 if [ "`pidof /usr/sbin/qmail-send`" ] ; then
54 let numdots
=$numdots+1
61 # If it's not dead yet, kill it.
62 # if [ "`pidof /usr/sbin/qmail-send`" ] ; then
64 # kill -KILL `pidof /usr/sbin/qmail-send`
82 echo "Reloading 'locals' and 'virtualdomains' control files."
83 start-stop-daemon
--stop
--quiet
--oknodo
--signal HUP
--exec /usr
/sbin
/qmail-send
86 echo 'Usage: /etc/init.d/qmail {start|stop|restart|reload}'