/etc/init.d/courier-mta is in courier-mta 0.68.2-1ubuntu3.
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 129 130 131 132 | #! /bin/sh -e
### BEGIN INIT INFO
# Short-Description: Courier SMTP server
# Provides: courier-mta mail-transport-agent
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: courier-mta is a Mail Transport agent
### END INIT INFO
prefix="/usr"
exec_prefix=${prefix}
sysconfdir="/etc/courier"
sbindir="${exec_prefix}/sbin"
libexecdir="${prefix}/lib/courier"
run_dir="/var/run/courier"
calendar_dir="/var/run/courier/calendar"
DAEMON=${sbindir}/esmtpd
test -f $DAEMON || exit 0
test -f "$sysconfdir/esmtpd" || exit 0
test -f "$sysconfdir/esmtpd-msa" || exit 0
if [ ! -d ${run_dir} ]; then
mkdir -p ${run_dir}
chown daemon:daemon ${run_dir}
fi
# Check if SMTP server should be started
. ${sysconfdir}/esmtpd
START_MTA=no
case "$ESMTPDSTART" in
[yY]*)START_MTA=yes;;
esac
START_MSA=no
. ${sysconfdir}/esmtpd-msa
case "$ESMTPDSTART" in
[yY]*)START_MSA=yes;;
esac
if [ "$START_MTA" = "no" ] && [ $START_MSA = "no" ]; then
exit 0
fi
. /lib/lsb/init-functions
case "$1" in
start)
cd /
# ensure proper permissions on /var/run/courier
chgrp daemon /var/run/courier
chmod g+rwx /var/run/courier
log_begin_msg "Starting Courier mail server..."
${sbindir}/courier start || log_end_msg 1
log_end_msg 0
log_begin_msg "Starting Courier mail filter..."
${sbindir}/courierfilter start || log_end_msg 1
log_end_msg 0
if [ "$START_MTA" = "yes" ]; then
log_begin_msg "Starting Courier SMTP server..."
${sbindir}/esmtpd start || log_end_msg 1
log_end_msg 0
fi
if [ "$START_MSA" = "yes" ]; then
log_begin_msg "Starting Courier SMTP MSA server..."
${sbindir}/esmtpd-msa start || log_end_msg 1
log_end_msg 0
fi
;;
stop)
cd /
if [ "$START_MSA" = "yes" ]; then
log_begin_msg "Stopping Courier SMTP MSA server..."
${sbindir}/esmtpd-msa stop || log_end_msg 1
log_end_msg 0
fi
if [ "$START_MTA" = "yes" ]; then
log_begin_msg "Stopping Courier SMTP server..."
${sbindir}/esmtpd stop || log_end_msg 1
log_end_msg 0
fi
log_begin_msg "Stopping Courier mail filter..."
${sbindir}/courierfilter stop || log_end_msg 1
log_end_msg 0
log_begin_msg "Stopping Courier mail server..."
${sbindir}/courier stop || log_end_msg 1
log_end_msg 0
;;
force-reload)
cd /
if [ "$START_MSA" = "yes" ]; then
log_begin_msg "Restarting Courier SMTP MSA server..."
${sbindir}/esmtpd-msa restart || log_end_msg 1
log_end_msg 0
fi
if [ "$START_MTA" = "yes" ]; then
log_begin_msg "Restarting Courier SMTP server..."
${sbindir}/esmtpd restart || log_end_msg 1
log_end_msg 0
fi
log_begin_msg "Restarting Courier mail filter..."
${sbindir}/courierfilter restart || log_end_msg 1
log_end_msg 0
log_begin_msg "Restarting Courier mail server..."
${sbindir}/courier restart || log_end_msg 1
log_end_msg 0
;;
restart)
$0 stop
$0 start
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0
|