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.\" $DragonFly: src/share/man/man8/rc.sendmail.8,v 1.4 2008/05/02 02:05:06 swildner Exp $ 29.\" 30.Dd March 30, 2002 31.Dt RC.SENDMAIL 8 32.Os 33.Sh NAME 34.Nm rc.sendmail 35.Nd 36.Xr sendmail 8 37startup script 38.Sh DESCRIPTION 39The 40.Nm 41script is used by 42.Pa /etc/rc 43at boot time to start 44.Xr sendmail 8 . 45It is meant to be 46.Xr sendmail 8 47specific and not a generic script for all MTAs. 48It is only called by 49.Pa /etc/rc 50if the 51.Xr rc.conf 5 52.Va mta_start_script 53variable is set to 54.Pa /etc/rc.sendmail . 55.Pp 56The 57.Nm 58script can take an optional argument specifying the action to 59perform. 60The available actions are: 61.Bl -tag -width ".Cm restart-mspq" 62.It Cm start 63Starts both the MTA and the MSP queue runner. 64.It Cm stop 65Stops both the MTA and the MSP queue runner. 66.It Cm restart 67Restarts both the MTA and the MSP queue runner. 68.It Cm start-mta 69Starts just the MTA. 70.It Cm stop-mta 71Stops just the MTA. 72.It Cm restart-mta 73Restarts just the MTA. 74.It Cm start-mspq 75Starts just the MSP queue runner. 76.It Cm stop-mspq 77Stops just the MSP queue runner. 78.It Cm restart-mspq 79Restarts just the MSP queue runner. 80.El 81.Pp 82If no action is specified, 83.Cm start 84is assumed. 85.Pp 86The 87.Nm 88script is also used by 89.Pa /etc/mail/Makefile 90to enable the 91.Pa Makefile Ns 's 92.Cm start , stop , 93and 94.Cm restart 95targets. 96.Sh RC.CONF VARIABLES 97The following variables affect the behavior of 98.Nm . 99They are defined in 100.Pa /etc/defaults/rc.conf 101and can be changed in 102.Pa /etc/rc.conf . 103.Bl -tag -width indent 104.It Va sendmail_enable 105.Pq Vt str 106If set to 107.Dq Li YES , 108run the 109.Xr sendmail 8 110daemon at system boot time. 111If set to 112.Dq Li NO , 113do not run a 114.Xr sendmail 8 115daemon to listen for incoming network mail. 116This does not preclude a 117.Xr sendmail 8 118daemon listening on the SMTP port of the loopback interface. 119The 120.Dq Li NONE 121option is deprecated and should not be used. 122It will be removed in a future release. 123.It Va sendmail_flags 124.Pq Vt str 125If 126.Va sendmail_enable 127is set to 128.Dq Li YES , 129these are the flags to pass to the 130.Xr sendmail 8 131daemon. 132.It Va sendmail_submit_enable 133.Pq Vt bool 134If set to 135.Dq Li YES 136and 137.Va sendmail_enable 138is set to 139.Dq Li NO , 140run 141.Xr sendmail 8 142using 143.Va sendmail_submit_flags 144instead of 145.Va sendmail_flags . 146This is intended to allow local mail submission via 147a localhost-only listening SMTP service required for running 148.Xr sendmail 8 149as a non-set-user-ID binary. 150Note that this does not work inside 151.Xr jail 2 152systems, as jails do not allow binding to just the localhost interface. 153.It Va sendmail_submit_flags 154.Pq Vt str 155If 156.Va sendmail_enable 157is set to 158.Dq Li NO 159and 160.Va sendmail_submit_enable 161is set to 162.Dq Li YES , 163these are the flags to pass to the 164.Xr sendmail 8 165daemon. 166.It Va sendmail_outbound_enable 167.Pq Vt bool 168If set to 169.Dq Li YES 170and both 171.Va sendmail_enable 172and 173.Va sendmail_submit_enable 174are set to 175.Dq Li NO , 176run 177.Xr sendmail 8 178using 179.Va sendmail_outbound_flags 180instead of 181.Va sendmail_flags . 182This is intended to allow local mail queue management 183for systems that do not offer a listening SMTP service. 184.It Va sendmail_outbound_flags 185.Pq Vt str 186If both 187.Va sendmail_enable 188and 189.Va sendmail_submit_enable 190are set to 191.Dq Li NO 192and 193.Va sendmail_outbound_enable 194is set to 195.Dq Li YES , 196these are the flags to pass to the 197.Xr sendmail 8 198daemon. 199.It Va sendmail_msp_queue_enable 200.Pq Vt bool 201If set to 202.Dq Li YES , 203start a client (MSP) queue runner 204.Xr sendmail 8 205daemon at system boot time. 206As of sendmail 8.12, a separate queue is used for command line 207submissions. 208The client queue runner ensures that nothing is 209left behind in the submission queue. 210.It Va sendmail_msp_queue_flags 211.Pq Vt str 212If 213.Va sendmail_msp_queue_enable 214is set to 215.Dq Li YES , 216these are the flags to pass to the 217.Xr sendmail 8 218daemon. 219.El 220.Pp 221These variables are used to determine how the 222.Xr sendmail 8 223daemons are started: 224.Bd -literal -offset indent 225# MTA 226if (${sendmail_enable} == NONE) 227 # Do nothing 228else if (${sendmail_enable} == YES) 229 start sendmail with ${sendmail_flags} 230else if (${sendmail_submit_enable} == YES) 231 start sendmail with ${sendmail_submit_flags} 232else if (${sendmail_outbound_enable} == YES) 233 start sendmail with ${sendmail_outbound_flags} 234endif 235 236# MSP Queue Runner 237if (${sendmail_enable} != NONE && 238 [ -r /etc/mail/submit.cf] && 239 ${sendmail_msp_queue_enable} == YES) 240 start sendmail with ${sendmail_msp_queue_flags} 241endif 242.Ed 243.Pp 244To completely prevent any 245.Xr sendmail 8 246daemons from starting, you must 247set the following variables in 248.Pa /etc/rc.conf : 249.Bd -literal -offset indent 250sendmail_enable="NO" 251sendmail_submit_enable="NO" 252sendmail_outbound_enable="NO" 253sendmail_msp_queue_enable="NO" 254.Ed 255.Sh SEE ALSO 256.Xr rc.conf 5 , 257.Xr rc 8 , 258.Xr sendmail 8 259.Sh HISTORY 260The 261.Nm 262file appeared in 263.Fx 4.6 . 264