/usr/bin/qmailctl is in qmail-run 2.0.2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | #!/bin/sh
# This is the qmailctl script from http://lifewithqmail.org (2.8.2.1.)
# with minor changes for Debian.
# For Red Hat chkconfig
# chkconfig: - 80 30
# description: the qmail MTA
PATH=/var/lib/qmail/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
export PATH
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
case "$1" in
start)
echo "Starting qmail"
if svok /etc/service/qmail-send ; then
svc -u /etc/service/qmail-send /etc/service/qmail-send/log
else
echo "qmail-send supervise not running"
fi
if svok /etc/service/qmail-smtpd ; then
svc -u /etc/service/qmail-smtpd /etc/service/qmail-smtpd/log
else
echo "qmail-smtpd supervise not running"
fi
if svok /etc/service/qmail-verify ; then
svc -u /etc/service/qmail-verify /etc/service/qmail-verify/log
else
echo "qmail-verify supervise not running"
fi
if [ -d /var/lock/subsys ]; then
touch /var/lock/subsys/qmail
fi
;;
stop)
echo "Stopping qmail..."
echo " qmail-smtpd"
svc -d /etc/service/qmail-smtpd /etc/service/qmail-smtpd/log
echo " qmail-send"
svc -d /etc/service/qmail-send /etc/service/qmail-send/log
echo " qmail-verify"
svc -d /etc/service/qmail-verify /etc/service/qmail-verify/log
if [ -f /var/lock/subsys/qmail ]; then
rm /var/lock/subsys/qmail
fi
;;
stat)
svstat /etc/service/qmail-send
svstat /etc/service/qmail-send/log
svstat /etc/service/qmail-smtpd
svstat /etc/service/qmail-smtpd/log
svstat /etc/service/qmail-verify
svstat /etc/service/qmail-verify/log
qmail-qstat
;;
doqueue|alrm|flush)
echo "Flushing timeout table and sending ALRM signal to qmail-send."
qmail-tcpok
svc -a /etc/service/qmail-send
;;
queue)
qmail-qstat
qmail-qread
;;
reload|hup)
echo "Sending HUP signal to qmail-send."
svc -h /etc/service/qmail-send
;;
pause)
echo "Pausing qmail-send"
svc -p /etc/service/qmail-send
echo "Pausing qmail-smtpd"
svc -p /etc/service/qmail-smtpd
echo "Pausing qmail-verify"
svc -p /etc/service/qmail-verify
;;
cont)
echo "Continuing qmail-send"
svc -c /etc/service/qmail-send
echo "Continuing qmail-smtpd"
svc -c /etc/service/qmail-smtpd
echo "Continuing qmail-verify"
svc -c /etc/service/qmail-verify
;;
restart)
echo "Restarting qmail:"
echo "* Stopping qmail-smtpd."
svc -d /etc/service/qmail-smtpd /etc/service/qmail-smtpd/log
echo "* Sending qmail-send SIGTERM and restarting."
svc -t /etc/service/qmail-send /etc/service/qmail-send/log
echo "* Sending qmail-verify SIGTERM and restarting."
svc -t /etc/service/qmail-verify /etc/service/qmail-verify/log
echo "* Restarting qmail-smtpd."
svc -u /etc/service/qmail-smtpd /etc/service/qmail-smtpd/log
;;
cdb)
tcprules /etc/qmail/tcp.smtp.cdb /etc/qmail/tcp.smtp.tmp \
< /etc/qmail/tcp.smtp
chmod 644 /etc/qmail/tcp.smtp.cdb
echo "Reloaded /etc/qmail/tcp.smtp."
;;
help)
cat <<HELP
stop -- stops mail service (smtp connections refused, nothing goes out)
start -- starts mail service (smtp connection accepted, mail can go out)
pause -- temporarily stops mail service (connections accepted, nothing leaves)
cont -- continues paused mail service
stat -- displays status of mail service
cdb -- rebuild the tcpserver cdb file for smtp
restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it
doqueue -- schedules queued messages for immediate delivery
reload -- sends qmail-send HUP, rereading locals and virtualdomains
queue -- shows status of queue
alrm -- same as doqueue
flush -- same as doqueue
hup -- same as reload
HELP
;;
*)
echo "Usage: $0 {start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help}"
exit 1
;;
esac
exit 0
|