Initial import from FreeBSD RELENG_4:
[dragonfly.git] / share / man / man8 / rc.sendmail.8
1 .\" Copyright (c) 1995
2 .\"     Jordan K. Hubbard
3 .\" Copyright (c) 2002 The FreeBSD Project
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\"
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" SUCH DAMAGE.
26 .\"
27 .\" $FreeBSD: src/share/man/man8/rc.sendmail.8,v 1.1.2.2 2002/05/22 17:01:33 gshapiro Exp $
28 .\"
29 .Dd March 30, 2002
30 .Dt RC.SENDMAIL 8
31 .Os
32 .Sh NAME
33 .Nm rc.sendmail
34 .Nd
35 .Xr sendmail 8
36 startup script
37 .Sh DESCRIPTION
38 The
39 .Nm
40 script is used by
41 .Pa /etc/rc
42 at boot time to start
43 .Xr sendmail 8 .
44 It is meant to be
45 .Xr sendmail 8
46 specific and not a generic script for all MTAs.
47 It is only called by
48 .Pa /etc/rc
49 if the
50 .Xr rc.conf 5
51 .Va mta_start_script
52 variable is set to
53 .Pa /etc/rc.sendmail .
54 .Pp
55 The
56 .Nm
57 script can take an optional argument specifying the action to
58 perform.
59 The available actions are:
60 .Bl -tag -width ".Cm restart-mspq"
61 .It Cm start
62 Starts both the MTA and the MSP queue runner.
63 .It Cm stop
64 Stops both the MTA and the MSP queue runner.
65 .It Cm restart
66 Restarts both the MTA and the MSP queue runner.
67 .It Cm start-mta
68 Starts just the MTA.
69 .It Cm stop-mta
70 Stops just the MTA.
71 .It Cm restart-mta
72 Restarts just the MTA.
73 .It Cm start-mspq
74 Starts just the MSP queue runner.
75 .It Cm stop-mspq
76 Stops just the MSP queue runner.
77 .It Cm restart-mspq
78 Restarts just the MSP queue runner.
79 .El
80 .Pp
81 If no action is specified,
82 .Cm start
83 is assumed.
84 .Pp
85 The
86 .Nm
87 script is also used by
88 .Pa /etc/mail/Makefile
89 to enable the
90 .Pa Makefile Ns 's
91 .Cm start , stop ,
92 and
93 .Cm restart
94 targets.
95 .Sh RC.CONF VARIABLES
96 The following variables effect the behavior of
97 .Nm .
98 They are defined in
99 .Pa /etc/defaults/rc.conf
100 and can be changed in
101 .Pa /etc/rc.conf .
102 .Bl -tag -width indent
103 .It Va sendmail_enable
104 .Pq Vt str
105 If set to
106 .Dq YES ,
107 run the
108 .Xr sendmail 8
109 daemon at system boot time.
110 If set to
111 .Dq NONE ,
112 do not run any
113 .Xr sendmail 8
114 daemons at system boot time.
115 .It Va sendmail_flags
116 .Pq Vt str
117 If
118 .Va sendmail_enable
119 is set to
120 .Dq YES ,
121 these are the flags to pass to the
122 .Xr sendmail 8
123 daemon.
124 .It Va sendmail_submit_enable
125 .Pq Vt bool
126 If set to
127 .Dq YES
128 and
129 .Va sendmail_enable
130 is set to
131 .Dq NO ,
132 run
133 .Xr sendmail 8
134 using
135 .Va sendmail_submit_flags
136 instead of
137 .Va sendmail_flags .
138 This is intended to allow local mail submission via
139 a localhost-only listening SMTP service required for running
140 .Xr sendmail 8
141 as a non-set-user-ID binary.
142 Note that this does not work inside
143 .Xr jail 2
144 systems as jails do not allow binding to just the localhost interface.
145 .It Va sendmail_submit_flags
146 .Pq Vt str
147 If
148 .Va sendmail_enable
149 is set to
150 .Dq NO
151 and
152 .Va sendmail_submit_enable
153 is set to
154 .Dq YES ,
155 these are the flags to pass to the
156 .Xr sendmail 8
157 daemon.
158 .It Va sendmail_outbound_enable
159 .Pq Vt bool
160 If set to
161 .Dq YES
162 and both
163 .Va sendmail_enable
164 and
165 .Va sendmail_submit_enable
166 are set to
167 .Dq NO ,
168 run
169 .Xr sendmail 8
170 using
171 .Va sendmail_outbound_flags
172 instead of
173 .Va sendmail_flags .
174 This is intended to allow local mail queue management
175 for systems that do not offer a listening SMTP service.
176 .It Va sendmail_outbound_flags
177 .Pq Vt str
178 If both
179 .Va sendmail_enable
180 and
181 .Va sendmail_submit_enable
182 are set to
183 .Dq NO
184 and
185 .Va sendmail_outbound_enable
186 is set to
187 .Dq YES ,
188 these are the flags to pass to the
189 .Xr sendmail 8
190 daemon.
191 .It Va sendmail_msp_queue_enable
192 .Pq Vt bool
193 If set to
194 .Dq YES ,
195 start a client (MSP) queue runner
196 .Xr sendmail 8
197 daemon at system boot time.
198 As of sendmail 8.12, a separate queue is used for command line
199 submissions.
200 The client queue runner assures that nothing is
201 left behind in the submission queue.
202 .It Va sendmail_msp_queue_flags
203 .Pq Vt str
204 If
205 .Va sendmail_msp_queue_enable
206 is set to
207 .Dq YES ,
208 these are the flags to pass to the
209 .Xr sendmail 8
210 daemon.
211 .El
212 .Pp
213 These variables are used to determine how the
214 .Xr sendmail 8
215 daemons are started:
216 .Pp
217 .Bd -literal -offset indent
218 # MTA
219 if (${sendmail_enable} == NONE)
220         # Do nothing
221 else if (${sendmail_enable} == YES)
222         start sendmail with ${sendmail_flags}
223 else if (${sendmail_submit_enable} == YES)
224         start sendmail with ${sendmail_submit_flags}
225 else if (${sendmail_outbound_enable} == YES)
226         start sendmail with ${sendmail_outbound_flags}
227 endif
228
229 # MSP Queue Runner
230 if (${sendmail_enable} != NONE &&
231     [ -r /etc/mail/submit.cf] &&
232     ${sendmail_msp_queue_enable} == YES)
233         start sendmail with ${sendmail_msp_queue_flags}
234 endif
235 .Ed
236 .Sh SEE ALSO
237 .Xr rc.conf 5 ,
238 .Xr rc 8 ,
239 .Xr sendmail 8
240 .Sh HISTORY
241 The
242 .Nm
243 file appeared in
244 .Fx 4.6 .