Deleted Added
full compact
sendmail (98261) sendmail (102864)
1#!/bin/sh
2#
3# $NetBSD: sendmail,v 1.14 2002/02/12 01:26:36 lukem Exp $
1#!/bin/sh
2#
3# $NetBSD: sendmail,v 1.14 2002/02/12 01:26:36 lukem Exp $
4# $FreeBSD: head/etc/rc.d/sendmail 98261 2002-06-15 18:39:05Z gordon $
4# $FreeBSD: head/etc/rc.d/sendmail 102864 2002-09-02 20:37:03Z gordon $
5#
6
7# PROVIDE: mail
8# REQUIRE: LOGIN
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
12
13# XXX - Get together with sendmail mantainer to figure out how to
14# better handle SENDMAIL_ENABLE and 3rd party MTAs.
15#
16. /etc/rc.subr
17
18name="sendmail"
19rcvar=`set_rcvar`
5#
6
7# PROVIDE: mail
8# REQUIRE: LOGIN
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
12
13# XXX - Get together with sendmail mantainer to figure out how to
14# better handle SENDMAIL_ENABLE and 3rd party MTAs.
15#
16. /etc/rc.subr
17
18name="sendmail"
19rcvar=`set_rcvar`
20command="/usr/sbin/${name}"
21pidfile="/var/run/${name}.pid"
22required_files="/etc/mail/${name}.cf"
20required_files="/etc/mail/${name}.cf"
23start_precmd="sendmail_precmd"
24
21
22case `${CMD_OSTYPE}` in
23FreeBSD)
24 command=${sendmail_program:-/usr/sbin/sendmail}
25 pidfile=${sendmail_pidfile:-/var/run/sendmail.pid}
26
27 load_rc_config $name
28
29 case ${sendmail_enable} in
30 [Nn][Oo][Nn][Ee])
31 sendmail_enable="NO"
32 sendmail_submit_enable="NO"
33 sendmail_outbound_enable="NO"
34 sendmail_msp_queue_enable="NO"
35 ;;
36 esac
37 ;;
38NetBSD)
39 command="/usr/sbin/${name}"
40 pidfile="/var/run/${name}.pid"
41 start_precmd="sendmail_precmd"
42
43 load_rc_config $name
44 ;;
45esac
46
25sendmail_precmd()
26{
27 # Die if there's pre-8.10 custom configuration file. This check is
28 # mandatory for smooth upgrade. See NetBSD PR 10100 for details.
29 #
30 if checkyesno ${rcvar} && [ -f "/etc/${name}.cf" ]; then
31 if ! cmp -s "/etc/mail/${name}.cf" "/etc/${name}.cf"; then
32 warn \

--- 21 unchanged lines hidden (view full) ---

54 "/etc/mail/$f" -nt "/etc/mail/$f.db" ]; then
55 echo \
56 "${name}: /etc/mail/$f newer than /etc/mail/$f.db, regenerating"
57 /usr/sbin/makemap hash /etc/mail/$f < /etc/mail/$f
58 fi
59 done
60}
61
47sendmail_precmd()
48{
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.
51 #
52 if checkyesno ${rcvar} && [ -f "/etc/${name}.cf" ]; then
53 if ! cmp -s "/etc/mail/${name}.cf" "/etc/${name}.cf"; then
54 warn \

--- 21 unchanged lines hidden (view full) ---

76 "/etc/mail/$f" -nt "/etc/mail/$f.db" ]; then
77 echo \
78 "${name}: /etc/mail/$f newer than /etc/mail/$f.db, regenerating"
79 /usr/sbin/makemap hash /etc/mail/$f < /etc/mail/$f
80 fi
81 done
82}
83
62load_rc_config $name
63run_rc_command "$1"
64
65case `${CMD_OSTYPE}` in
66FreeBSD)
84run_rc_command "$1"
85
86case `${CMD_OSTYPE}` in
87FreeBSD)
67 case $sendmail_enable in
68 NONE)
69 exit
88 required_files=
89
90 # I'd like to use checkyesno here, but for reason, sendmail_enable
91 # get's reset after run_rc_command
92 case ${sendmail_enable} in
93 [Nn][Oo]*)
94 name="sendmail_submit"
95 rcvar=`set_rcvar`
96 start_cmd="${command} ${sendmail_submit_flags}"
97 run_rc_command "$1"
70 ;;
71 esac
98 ;;
99 esac
72 pid_file=
73 required_files=
74 start_precmd=
75
100
76 name="sendmail_outbound"
77 rcvar=`set_rcvar`
78 start_cmd="/usr/sbin/sendmail $sendmail_outbound_flags"
79 #command="/usr/sbin/sendmail"
101 if ! checkyesno sendmail_outbound_enable; then
102 name="sendmail_outbound"
103 rcvar=`set_rcvar`
104 start_cmd="${command} ${sendmail_outbound_flags}"
105 run_rc_command "$1"
106 fi
80
107
81 load_rc_config $name
82 run_rc_command "$1"
83
84 name="sendmail_submit"
85 rcvar=`set_rcvar`
86 start_cmd="/usr/sbin/sendmail $sendmail_submit_flags"
87 #command="/usr/sbin/sendmail"
88
89 load_rc_config $name
90 run_rc_command "$1"
91
92 name="sendmail_clientmqueue"
93 rcvar="sendmail_msp_queue_enable"
108 name="sendmail_clientmqueue"
109 rcvar="sendmail_msp_queue_enable"
94 start_cmd="/usr/sbin/sendmail $sendmail_msp_queue_flags"
95 #command="/usr/sbin/sendmail"
96 #command_args="${sendmail_msp_queue_flags}"
110 start_cmd="${command} ${sendmail_msp_queue_flags}"
111 pidfile="${sendmail_mspq_pidfile:-/var/spool/clientmqueue/sm-client.pid}"
97 required_files="/etc/mail/submit.cf"
112 required_files="/etc/mail/submit.cf"
98
99 load_rc_config $name
100 run_rc_command "$1"
101 ;;
102esac
113 run_rc_command "$1"
114 ;;
115esac