3 # $NetBSD: sendmail,v 1.14 2002/02/12 01:26:36 lukem Exp $
9 # KEYWORD: FreeBSD NetBSD
10 # we make mail start late, so that things like .forward's are not
11 # processed until the system is fully operational
13 # XXX - Get together with sendmail mantainer to figure out how to
14 # better handle SENDMAIL_ENABLE and 3rd party MTAs.
20 required_files="/etc/mail/${name}.cf"
24 command=${sendmail_program:-/usr/sbin/sendmail}
25 pidfile=${sendmail_pidfile:-/var/run/sendmail.pid}
29 case ${sendmail_enable} in
32 sendmail_submit_enable="NO"
33 sendmail_outbound_enable="NO"
34 sendmail_msp_queue_enable="NO"
39 command="/usr/sbin/${name}"
40 pidfile="/var/run/${name}.pid"
41 start_precmd="sendmail_precmd"
49 # Die if there's pre-8.10 custom configuration file. This check is
50 # mandatory for smooth upgrade. See NetBSD PR 10100 for details.
52 if checkyesno ${rcvar} && [ -f "/etc/${name}.cf" ]; then
53 if ! cmp -s "/etc/mail/${name}.cf" "/etc/${name}.cf"; then
55 "${name} was not started; you have multiple copies of sendmail.cf."
60 # check modifications on /etc/mail/aliases
61 if [ -f "/etc/mail/aliases.db" ]; then
62 if [ "/etc/mail/aliases" -nt "/etc/mail/aliases.db" ]; then
64 "${name}: /etc/mail/aliases newer than /etc/mail/aliases.db, regenerating"
69 "${name}: /etc/mail/aliases.db not present, generating"
73 # check couple of common db files, too
74 for f in genericstable virtusertable domaintable mailertable; do
75 if [ -r "/etc/mail/$f" -a \
76 "/etc/mail/$f" -nt "/etc/mail/$f.db" ]; then
78 "${name}: /etc/mail/$f newer than /etc/mail/$f.db, regenerating"
79 /usr/sbin/makemap hash /etc/mail/$f < /etc/mail/$f
90 if ! checkyesno sendmail_enable; then
91 name="sendmail_submit"
93 start_cmd="${command} ${sendmail_submit_flags}"
97 if ! checkyesno sendmail_outbound_enable; then
98 name="sendmail_outbound"
100 start_cmd="${command} ${sendmail_outbound_flags}"
104 name="sendmail_clientmqueue"
105 rcvar="sendmail_msp_queue_enable"
106 start_cmd="${command} ${sendmail_msp_queue_flags}"
107 pidfile="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
108 required_files="/etc/mail/submit.cf"