]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - share/man/man8/rc.sendmail.8
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.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$
28 .\"
29 .Dd October 19, 2013
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 affect 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 Li YES ,
107 run the
108 .Xr sendmail 8
109 daemon at system boot time.
110 If set to
111 .Dq Li NO ,
112 do not run a
113 .Xr sendmail 8
114 daemon to listen for incoming network mail.
115 This does not preclude a
116 .Xr sendmail 8
117 daemon listening on the SMTP port of the loopback interface.
118 The
119 .Dq Li NONE
120 option is deprecated and should not be used.
121 It will be removed in a future release.
122 .It Va sendmail_cert_create
123 .Pq Vt str
124 If
125 .Va sendmail_enable
126 is set to
127 .Dq Li YES ,
128 create a signed certificate
129 .Pa /etc/mail/certs/host.cert
130 representing
131 .Pa /etc/mail/certs/host.key
132 by the CA certificate in
133 .Pa /etc/mail/certs/cacert.pem .
134 This will enable connecting hosts to negotiate STARTTLS allowing incoming
135 email to be encrypted in transit.
136 .Xr sendmail 8
137 needs to be configured to use these generated files.
138 The default configuration in
139 .Pa /etc/mail/freebsd.mc
140 has the required options in it.
141 .It Va sendmail_cert_cn
142 .Pq Vt str
143 If
144 .Va sendmail_enable
145 is set to
146 .Dq Li YES
147 and
148 .Va sendmail_cert_create
149 is set to
150 .Dq Li YES ,
151 this is the Common Name (CN) of the certificate that will be created.
152 If
153 .Va sendmail_cert_cn
154 is not set, the system's hostname will be used.
155 If there is no hostname set,
156 .Dq Li amnesiac
157 will be used.
158 .It Va sendmail_flags
159 .Pq Vt str
160 If
161 .Va sendmail_enable
162 is set to
163 .Dq Li YES ,
164 these are the flags to pass to the
165 .Xr sendmail 8
166 daemon.
167 .It Va sendmail_submit_enable
168 .Pq Vt bool
169 If set to
170 .Dq Li YES
171 and
172 .Va sendmail_enable
173 is set to
174 .Dq Li NO ,
175 run
176 .Xr sendmail 8
177 using
178 .Va sendmail_submit_flags
179 instead of
180 .Va sendmail_flags .
181 This is intended to allow local mail submission via
182 a localhost-only listening SMTP service required for running
183 .Xr sendmail 8
184 as a non-set-user-ID binary.
185 Note that this does not work inside
186 .Xr jail 2
187 systems, as jails do not allow binding to just the localhost interface.
188 .It Va sendmail_submit_flags
189 .Pq Vt str
190 If
191 .Va sendmail_enable
192 is set to
193 .Dq Li NO
194 and
195 .Va sendmail_submit_enable
196 is set to
197 .Dq Li YES ,
198 these are the flags to pass to the
199 .Xr sendmail 8
200 daemon.
201 .It Va sendmail_outbound_enable
202 .Pq Vt bool
203 If set to
204 .Dq Li YES
205 and both
206 .Va sendmail_enable
207 and
208 .Va sendmail_submit_enable
209 are set to
210 .Dq Li NO ,
211 run
212 .Xr sendmail 8
213 using
214 .Va sendmail_outbound_flags
215 instead of
216 .Va sendmail_flags .
217 This is intended to allow local mail queue management
218 for systems that do not offer a listening SMTP service.
219 .It Va sendmail_outbound_flags
220 .Pq Vt str
221 If both
222 .Va sendmail_enable
223 and
224 .Va sendmail_submit_enable
225 are set to
226 .Dq Li NO
227 and
228 .Va sendmail_outbound_enable
229 is set to
230 .Dq Li YES ,
231 these are the flags to pass to the
232 .Xr sendmail 8
233 daemon.
234 .It Va sendmail_msp_queue_enable
235 .Pq Vt bool
236 If set to
237 .Dq Li YES ,
238 start a client (MSP) queue runner
239 .Xr sendmail 8
240 daemon at system boot time.
241 As of sendmail 8.12, a separate queue is used for command line
242 submissions.
243 The client queue runner ensures that nothing is
244 left behind in the submission queue.
245 .It Va sendmail_msp_queue_flags
246 .Pq Vt str
247 If
248 .Va sendmail_msp_queue_enable
249 is set to
250 .Dq Li YES ,
251 these are the flags to pass to the
252 .Xr sendmail 8
253 daemon.
254 .El
255 .Pp
256 These variables are used to determine how the
257 .Xr sendmail 8
258 daemons are started:
259 .Bd -literal -offset indent
260 # MTA
261 if (${sendmail_enable} == NONE)
262         # Do nothing
263 else if (${sendmail_enable} == YES)
264         start sendmail with ${sendmail_flags}
265 else if (${sendmail_submit_enable} == YES)
266         start sendmail with ${sendmail_submit_flags}
267 else if (${sendmail_outbound_enable} == YES)
268         start sendmail with ${sendmail_outbound_flags}
269 endif
270
271 # MSP Queue Runner
272 if (${sendmail_enable} != NONE &&
273     [ -r /etc/mail/submit.cf] &&
274     ${sendmail_msp_queue_enable} == YES)
275         start sendmail with ${sendmail_msp_queue_flags}
276 endif
277 .Ed
278 .Pp
279 To completely prevent any
280 .Xr sendmail 8
281 daemons from starting, you must
282 set the following variables in
283 .Pa /etc/rc.conf :
284 .Bd -literal -offset indent
285 sendmail_enable="NO"
286 sendmail_submit_enable="NO"
287 sendmail_outbound_enable="NO"
288 sendmail_msp_queue_enable="NO"
289 .Ed
290 .Sh SEE ALSO
291 .Xr rc.conf 5 ,
292 .Xr rc 8 ,
293 .Xr sendmail 8
294 .Sh HISTORY
295 The
296 .Nm
297 file appeared in
298 .Fx 4.6 .