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.4 2005/11/19 21:47:32 swildner Exp $
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"
21 start_precmd
="sendmail_precmd"
22 command=${sendmail_program:-/usr/sbin/sendmail}
23 pidfile
=${sendmail_pidfile:-/var/run/sendmail.pid}
25 case ${sendmail_enable} in
28 sendmail_submit_enable
="NO"
29 sendmail_outbound_enable
="NO"
30 sendmail_msp_queue_enable
="NO"
36 # Die if there's pre-8.10 custom configuration file. This check is
37 # mandatory for smooth upgrade. See NetBSD PR 10100 for details.
39 if checkyesno
${rcvar} && [ -f "/etc/${name}.cf" ]; then
40 if ! cmp -s "/etc/mail/${name}.cf" "/etc/${name}.cf"; then
42 "${name} was not started; you have multiple copies of sendmail.cf."
47 # check modifications on /etc/mail/aliases
48 if checkyesno sendmail_rebuild_aliases
; then
49 if [ -f "/etc/mail/aliases.db" ]; then
50 if [ "/etc/mail/aliases" -nt "/etc/mail/aliases.db" ]; then
52 "${name}: /etc/mail/aliases newer than /etc/mail/aliases.db, regenerating"
57 "${name}: /etc/mail/aliases.db not present, generating"
62 # check couple of common db files, too
63 for f
in genericstable virtusertable domaintable mailertable
; do
64 if [ -r "/etc/mail/$f" -a \
65 "/etc/mail/$f" -nt "/etc/mail/$f.db" ]; then
67 "${name}: /etc/mail/$f newer than /etc/mail/$f.db, regenerating"
68 /usr
/sbin
/makemap
hash /etc
/mail
/$f < /etc
/mail
/$f
76 if ! checkyesno sendmail_enable
; then
77 name
="sendmail_submit"
79 start_cmd
="${command} ${sendmail_submit_flags}"
82 if ! checkyesno sendmail_outbound_enable
; then
83 name
="sendmail_outbound"
85 start_cmd
="${command} ${sendmail_outbound_flags}"
88 name
="sendmail_clientmqueue"
89 rcvar
="sendmail_msp_queue_enable"
90 start_cmd
="${command} ${sendmail_msp_queue_flags}"
91 pidfile
="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
92 required_files
="/etc/mail/submit.cf"