summaryrefslogtreecommitdiffstats
path: root/share/man/man8/rc.sendmail.8
blob: d8dff43fdbe3e37ca7fb869940fcc07034c96c30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
.\" Copyright (c) 1995
.\"	Jordan K. Hubbard
.\" Copyright (c) 2002 The FreeBSD Project
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd October 19, 2013
.Dt RC.SENDMAIL 8
.Os
.Sh NAME
.Nm rc.sendmail
.Nd
.Xr sendmail 8
startup script
.Sh DESCRIPTION
The
.Nm
script is used by
.Pa /etc/rc
at boot time to start
.Xr sendmail 8 .
It is meant to be
.Xr sendmail 8
specific and not a generic script for all MTAs.
It is only called by
.Pa /etc/rc
if the
.Xr rc.conf 5
.Va mta_start_script
variable is set to
.Pa /etc/rc.sendmail .
.Pp
The
.Nm
script can take an optional argument specifying the action to
perform.
The available actions are:
.Bl -tag -width ".Cm restart-mspq"
.It Cm start
Starts both the MTA and the MSP queue runner.
.It Cm stop
Stops both the MTA and the MSP queue runner.
.It Cm restart
Restarts both the MTA and the MSP queue runner.
.It Cm start-mta
Starts just the MTA.
.It Cm stop-mta
Stops just the MTA.
.It Cm restart-mta
Restarts just the MTA.
.It Cm start-mspq
Starts just the MSP queue runner.
.It Cm stop-mspq
Stops just the MSP queue runner.
.It Cm restart-mspq
Restarts just the MSP queue runner.
.El
.Pp
If no action is specified,
.Cm start
is assumed.
.Pp
The
.Nm
script is also used by
.Pa /etc/mail/Makefile
to enable the
.Pa Makefile Ns 's
.Cm start , stop ,
and
.Cm restart
targets.
.Sh RC.CONF VARIABLES
The following variables affect the behavior of
.Nm .
They are defined in
.Pa /etc/defaults/rc.conf
and can be changed in
.Pa /etc/rc.conf .
.Bl -tag -width indent
.It Va sendmail_enable
.Pq Vt str
If set to
.Dq Li YES ,
run the
.Xr sendmail 8
daemon at system boot time.
If set to
.Dq Li NO ,
do not run a
.Xr sendmail 8
daemon to listen for incoming network mail.
This does not preclude a
.Xr sendmail 8
daemon listening on the SMTP port of the loopback interface.
The
.Dq Li NONE
option is deprecated and should not be used.
It will be removed in a future release.
.It Va sendmail_cert_create
.Pq Vt str
If
.Va sendmail_enable
is set to
.Dq Li YES ,
create a signed certificate
.Pa /etc/mail/certs/host.cert
representing
.Pa /etc/mail/certs/host.key
by the CA certificate in
.Pa /etc/mail/certs/cacert.pem .
This will enable connecting hosts to negotiate STARTTLS allowing incoming
email to be encrypted in transit.
.Xr sendmail 8
needs to be configured to use these generated files.
The default configuration in
.Pa /etc/mail/freebsd.mc
has the required options in it.
.It Va sendmail_cert_cn
.Pq Vt str
If
.Va sendmail_enable
is set to
.Dq Li YES
and
.Va sendmail_cert_create
is set to
.Dq Li YES ,
this is the Common Name (CN) of the certificate that will be created.
If
.Va sendmail_cert_cn
is not set, the system's hostname will be used.
If there is no hostname set,
.Dq Li amnesiac
will be used.
.It Va sendmail_flags
.Pq Vt str
If
.Va sendmail_enable
is set to
.Dq Li YES ,
these are the flags to pass to the
.Xr sendmail 8
daemon.
.It Va sendmail_submit_enable
.Pq Vt bool
If set to
.Dq Li YES
and
.Va sendmail_enable
is set to
.Dq Li NO ,
run
.Xr sendmail 8
using
.Va sendmail_submit_flags
instead of
.Va sendmail_flags .
This is intended to allow local mail submission via
a localhost-only listening SMTP service required for running
.Xr sendmail 8
as a non-set-user-ID binary.
Note that this does not work inside
.Xr jail 2
systems, as jails do not allow binding to just the localhost interface.
.It Va sendmail_submit_flags
.Pq Vt str
If
.Va sendmail_enable
is set to
.Dq Li NO
and
.Va sendmail_submit_enable
is set to
.Dq Li YES ,
these are the flags to pass to the
.Xr sendmail 8
daemon.
.It Va sendmail_outbound_enable
.Pq Vt bool
If set to
.Dq Li YES
and both
.Va sendmail_enable
and
.Va sendmail_submit_enable
are set to
.Dq Li NO ,
run
.Xr sendmail 8
using
.Va sendmail_outbound_flags
instead of
.Va sendmail_flags .
This is intended to allow local mail queue management
for systems that do not offer a listening SMTP service.
.It Va sendmail_outbound_flags
.Pq Vt str
If both
.Va sendmail_enable
and
.Va sendmail_submit_enable
are set to
.Dq Li NO
and
.Va sendmail_outbound_enable
is set to
.Dq Li YES ,
these are the flags to pass to the
.Xr sendmail 8
daemon.
.It Va sendmail_msp_queue_enable
.Pq Vt bool
If set to
.Dq Li YES ,
start a client (MSP) queue runner
.Xr sendmail 8
daemon at system boot time.
As of sendmail 8.12, a separate queue is used for command line
submissions.
The client queue runner ensures that nothing is
left behind in the submission queue.
.It Va sendmail_msp_queue_flags
.Pq Vt str
If
.Va sendmail_msp_queue_enable
is set to
.Dq Li YES ,
these are the flags to pass to the
.Xr sendmail 8
daemon.
.El
.Pp
These variables are used to determine how the
.Xr sendmail 8
daemons are started:
.Bd -literal -offset indent
# MTA
if (${sendmail_enable} == NONE)
        # Do nothing
else if (${sendmail_enable} == YES)
        start sendmail with ${sendmail_flags}
else if (${sendmail_submit_enable} == YES)
        start sendmail with ${sendmail_submit_flags}
else if (${sendmail_outbound_enable} == YES)
        start sendmail with ${sendmail_outbound_flags}
endif

# MSP Queue Runner
if (${sendmail_enable} != NONE &&
    [ -r /etc/mail/submit.cf] &&
    ${sendmail_msp_queue_enable} == YES)
        start sendmail with ${sendmail_msp_queue_flags}
endif
.Ed
.Pp
To completely prevent any
.Xr sendmail 8
daemons from starting, you must
set the following variables in
.Pa /etc/rc.conf :
.Bd -literal -offset indent
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
.Ed
.Sh SEE ALSO
.Xr rc.conf 5 ,
.Xr rc 8 ,
.Xr sendmail 8
.Sh HISTORY
The
.Nm
file appeared in
.Fx 4.6 .
OpenPOWER on IntegriCloud