3 # $NetBSD: sendmail,v 1.14 2002/02/12 01:26:36 lukem Exp $
4 # $FreeBSD: src/etc/rc.d/sendmail,v 1.7 2002/10/12 10:31:31 schweikh Exp $
5 # $DragonFly: src/etc/rc.d/sendmail,v 1.1 2003/07/24 06:35:37 dillon Exp $
10 # KEYWORD: DragonFly FreeBSD NetBSD
11 # we make mail start late, so that things like .forward's are not
12 # processed until the system is fully operational
14 # XXX - Get together with sendmail mantainer to figure out how to
15 # better handle SENDMAIL_ENABLE and 3rd party MTAs.
21 required_files="/etc/mail/${name}.cf"
25 command=${sendmail_program:-/usr/sbin/sendmail}
26 pidfile=${sendmail_pidfile:-/var/run/sendmail.pid}
28 case ${sendmail_enable} in
31 sendmail_submit_enable="NO"
32 sendmail_outbound_enable="NO"
33 sendmail_msp_queue_enable="NO"
39 command=${sendmail_program:-/usr/sbin/sendmail}
40 pidfile=${sendmail_pidfile:-/var/run/sendmail.pid}
44 case ${sendmail_enable} in
47 sendmail_submit_enable="NO"
48 sendmail_outbound_enable="NO"
49 sendmail_msp_queue_enable="NO"
54 command="/usr/sbin/${name}"
55 pidfile="/var/run/${name}.pid"
56 start_precmd="sendmail_precmd"
64 # Die if there's pre-8.10 custom configuration file. This check is
65 # mandatory for smooth upgrade. See NetBSD PR 10100 for details.
67 if checkyesno ${rcvar} && [ -f "/etc/${name}.cf" ]; then
68 if ! cmp -s "/etc/mail/${name}.cf" "/etc/${name}.cf"; then
70 "${name} was not started; you have multiple copies of sendmail.cf."
75 # check modifications on /etc/mail/aliases
76 if [ -f "/etc/mail/aliases.db" ]; then
77 if [ "/etc/mail/aliases" -nt "/etc/mail/aliases.db" ]; then
79 "${name}: /etc/mail/aliases newer than /etc/mail/aliases.db, regenerating"
84 "${name}: /etc/mail/aliases.db not present, generating"
88 # check couple of common db files, too
89 for f in genericstable virtusertable domaintable mailertable; do
90 if [ -r "/etc/mail/$f" -a \
91 "/etc/mail/$f" -nt "/etc/mail/$f.db" ]; then
93 "${name}: /etc/mail/$f newer than /etc/mail/$f.db, regenerating"
94 /usr/sbin/makemap hash /etc/mail/$f < /etc/mail/$f
104 if ! checkyesno sendmail_enable; then
105 name="sendmail_submit"
107 start_cmd="${command} ${sendmail_submit_flags}"
110 if ! checkyesno sendmail_outbound_enable; then
111 name="sendmail_outbound"
113 start_cmd="${command} ${sendmail_outbound_flags}"
116 name="sendmail_clientmqueue"
117 rcvar="sendmail_msp_queue_enable"
118 start_cmd="${command} ${sendmail_msp_queue_flags}"
119 pidfile="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
120 required_files="/etc/mail/submit.cf"
126 if ! checkyesno sendmail_enable; then
127 name="sendmail_submit"
129 start_cmd="${command} ${sendmail_submit_flags}"
133 if ! checkyesno sendmail_outbound_enable; then
134 name="sendmail_outbound"
136 start_cmd="${command} ${sendmail_outbound_flags}"
140 name="sendmail_clientmqueue"
141 rcvar="sendmail_msp_queue_enable"
142 start_cmd="${command} ${sendmail_msp_queue_flags}"
143 pidfile="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
144 required_files="/etc/mail/submit.cf"