'\" te .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH SENDMAIL 5 "May 8, 2008" .SH NAME sendmail, sendmail.cf, submit.cf \- sendmail configuration files .SH SYNOPSIS .LP \fB/etc/mail/sendmail.cf\fR .LP \fB/etc/mail/submit.cf\fR .SH DESCRIPTION .LP The \fBsendmail.cf\fR and \fBsubmit.cf\fR files are the configuration files for \fBsendmail\fR(8). Starting with version 8.12 of \fBsendmail\fR two configuration files are used for submission and transmission of mail, instead of only \fBsendmail.cf\fR, as before. These are: .TP \fBsendmail.cf\fR Remains the principal \fBsendmail\fR configuration file. Used for the Mail Transmission Agent (MTA). .TP \fBsubmit.cf\fR Used for the Mail Submission Program (MSP). The MSP is used to submit mail messages. Unlike the MTA, it does not run as an SMTP daemon. .LP The MSP does not require root privileges, thus the two-file model provides better security than the pre-\fBsendmail\fR 8.12 model, in which the MSP ran as a daemon and required root privileges. .LP In the default \fBsendmail\fR configuration, \fBsendmail\fR uses \fBsubmit.cf\fR, as indicated in \fBps\fR(1) output. In \fBps\fR output, you will observe two \fBsendmail\fR invocations, such as the ones below: .in +2 .nf /usr/sbin/sendmail -Ac -q15m /usr/sbin/sendmail -bd -q15m .fi .in -2 .LP The first indicates the use of \fBsubmit.cf\fR, with the client queue (\fB/var/spool/clientmqueue\fR) being checked and, if needed, flushed every 15 minutes. The second invocation runs \fBsendmail\fR as a daemon, waiting for incoming SMTP connections using the server queue (\fB/var/spool/mqueue\fR), which gets checked and, if needed, flushed every 15 minutes. .LP As shipped, \fBsendmail.cf\fR and, in particular, \fBsubmit.cf\fR, are appropriate for most environments. Where a knowledgeable system administrator needs to make a change, he should use the following procedures. .LP For \fBsendmail.cf\fR: .RS +4 .TP 1. Change directories to the directory that contains your sendmail m4 configuration files. .in +2 .nf # \fBcd /etc/mail/\fR .fi .in -2 .sp .TP 2. Create a backup of the \fBsendmail\fR file for your system. .in +2 .nf # \fBcp sendmail.mc sendmail.`hostname`.mc\fR .fi .in -2 .TP 3. Edit \fBsendmail.mc\fR. Make changes suitable for your system and environment. .TP 4. Run \fBm4\fR to generate the configuration file. .in +2 .nf # \fBm4 -D_CF_DIR_=/usr/lib/mail /usr/lib/mail/m4/cf.m4 \e\ .in +2 sendmail.mc > /tmp/sendmail.cf\fR .in -2 .fi .in -2 .TP 5. Copy the newly generated file to its correct location. .in +2 .nf # \fBcp /tmp/sendmail.cf /etc/mail/sendmail.cf\fR .fi .in -2 .TP 6. Restart the \fBsendmail\fR service. .LP You must restart \fBsendmail\fR for \fBsendmail.cf\fR file changes to take effect, as indicated in step 6. Steps 4 - 6 can be automated. See \fBAutomated Rebuilding of Configuration Files\fR below. .RE .LP For \fBsubmit.cf\fR the procedure is the same - just use submit in instead of sendmail: .RS +4 .TP 1. Change directories to the directory that contains the source files for the configuration files. .in +2 .nf # \fBcd /etc/mail/\fR .fi .in -2 .TP 2. Create a backup of the \fBsubmit\fR file for your system. .in +2 .nf # \fBcp submit.mc submit.`hostname`.mc\fR .fi .in -2 .TP 3. Edit \fBsubmit.mc\fR. Make changes suitable for your system and environment. .TP 4. Run \fBm4\fR to generate the configuration file. .in +2 .nf # \fBm4 -D_CF_DIR_=/usr/lib/mail /usr/lib/mail/m4/cf.m4 \e\ .in +2 submit.mc > /tmp/submit.cf\fR .in -2 .fi .in -2 .TP 5. Copy the newly generated file to its correct location. .in +2 .nf # \fBcp /tmp/submit.cf /etc/mail/submit.cf\fR .fi .in -2 .RE .LP You do not need to restart \fBsendmail\fR for changes to \fBsubmit.cf\fR to take effect. Steps 4 and 5 can be automated. See \fBAutomated Rebuilding of Configuration Files\fR below. .SS "Enabling Access to Remote Clients" .LP As described in \fBsendmail\fR(8) per default access to the sendmail server by remote clients is per default disabled and thus only local mail clients are able to send mail via this service. To enable access for remote clients as well the service property \fBLOCAL_ONLY\fR needs to be set to \fBfalse\fR, to disable it again to \fBtrue\fR, e.g: .in +2 .nf # sed -i -e '/LOCAL_ONLY=/ s,=.*,=false,' /etc/default/sendmail # initctl restart sendmail .fi .in -2 .LP Note, however, on a system where any of the \fBsendmail\fR(5) files have been customized or Startup Options have been changed, setting this property might not have the intended effect. .SS "Automated Rebuilding of Configuration Files" .LP The sendmail server service \fBsendmail\fR as well as the sendmail client service \fBsendmail-client\fR can be instructed to verify \fBon startup\fR, whether the last modified time of the related m4 configuration file differs from the sendmail configuration file to use, and if so, to rebuild the configuration file before starting the daemon. .LP To enable this for the server service, on needs to set in \fB/etc/default/sendmail\fR the service option \fBPATH_TO_MC\fR to the absolute path of the m4 configuration file to use. Optionally one may also explicitly set the sendmail configuration file to use (default is \fB/etc/mail/sendmail.cf\fR): .nf .in +2 # sed -i -e '/PATH_TO_MC=/ s,=.*,=/etc/mail/sendmail.mc,' \e # -e '/PATH_TO_CF=/ s,=.*,=/etc/mail/sendmail.cf,' \e # /etc/default/sendmail .in -2 .fi .LP For the client service this is almost the same, however, the service property \fBCLIENTPATH_TO_MC\fR needs to be set to point to the m4 configuration file to use instead: .nf .in +2 # sed -i -e '/CLIENTPATH_TO_MC=/ s,=.*,=/etc/mail/submit.mc,' \e # -e '/CLIENTPATH_TO_CF=/ s,=.*,=/etc/mail/submit.cf,' \e # /etc/default/sendmail .in -2 .fi .LP Just in case one wants m4 to omit comments about when and by whom the cf file has been generated, one may set the service property \fBINCLUDE_INFO\fR to \fBfalse\fR: .nf .in +2 # sed -i -e '/INCLUDE_INFO=/ s,=.*,=false,' /etc/default/sendmail .in -2 .fi .LP All the mentioned properties persist across upgrades and patches. To prevent a patch or upgrade from clobbering your \fB\&.cf\fR file, or renaming it to \fB\&.cf.old\fR, just set the desired properties. .SS "Startup Options" .LP The service specific options should be stored in the \fB/etc/default/sendmail\fR file, so that they are not removed when a host is upgraded (and e.g. the startup script gets replaced). For historical reason one also store some add. startup options, however, since almost every option is configurable via the sendmail [m4] configuration file, it is recomended to persist the options there. .LP The sendmail server service supports the following variables in \fB/etc/default/sendmail\fR: .RS +2 \- \fBOPTIONS\fB .br \- \fBQUEUEINTERVAL\fB .br \- \fBMODE\fB .br \- \fBQUEUEOPTIONS\fB .br \- \fBETRN_HOSTS\fB .br \- \fBPATH_TO_MC\fB .br \- \fBPATH_TO_CF\fB .br \- \fBINCLUDE_INFO\fB .br \- \fBLOCAL_ONLY\fB .RE .LP For the client service all variable names need to be prefixed with \fBCLIENT\fR (e.g. CLIENTOPTIONS). Note that the file is sourced in as a shell snippet and thus must conform to ksh93 syntax. This means especially wrt. this file there must no space between the ithe variable name, the \fB=\fR, and the variable value. No value is allowed and handled the same way like ''. .TP \fBMODE\fR={\fB-bd\fR|\fB-Ac\fR} Leave it undefined unless you really know, what you are doing. It selects the mode to start \fBsendmail\fR with. For the server use \fB-bd\fR, for the client \fB-Ac\fR. .TP \fBQUEUEINTERVAL\fR=\fI#\fR Sets the interval for mail queue runs. \fI#\fR can be a positive integer that is followed by either \fBs\fR for seconds, \fBm\fR for minutes, \fBh\fR for hours, \fBd\fR for days, or \fBw\fR for weeks. The syntax is checked before \fBsendmail\fR is started. If the interval is negative or if the entry does not end with an appropriate letter, the interval is ignored and \fBsendmail\fR starts with the default queue interval of 15 minutes. .TP \fBQUEUEOPTIONS\fR=\fBp\fR Enables one persistent queue runner that sleeps between queue run intervals, instead of a new queue runner for each queue run interval. You can set this option to \fBp\fR, which is the only setting available. The corresponding service property \fBconfig/prunner\fR in contrast accepts \fBtrue\fR or \fBfalse\fR, only. The value gets ignored, if it is unknown. .TP \fBOPTIONS\fR=\fIstring\fR Selects additional options to be used when the sendmail daemon gets started. No syntax checking is done, so be careful when making changes to this variable. .TP \fBETRN_HOSTS\fR=\fIstring\fR This option gets honored by the sendmail server service, only. It instructs the service on startup to connect to the specified servers and ask them to process all jobs for the given clients in its queue immediately by sending an appropriate \fBETRN\fR command (see also \fBetrn\fR(1M)). This is comparable to running \fB/usr/lib/sendmail\ -qR\fR\fIclient\fR on the corresponding server. The \fIstring\fR allowed here represents a space separated list of \fIserver1\fR[\fB:\fR\fIclient1\fR[\fB,\fR\fIclient2\fR]...] . If no client list is specified for an server, \fBetrn\fR(1M) tries to determine the name of the running host as well as the local-host-names file (aka cw file) and uses these names (if any) instead. But note, that \fBetrn\fR(1M) uses the hardcoded \fB/etc/mail/sendmail.cf\fR for this! Also sendmail servers may deny the use of the \fBETRN\fR command depending on their configuration. .LP .B Examples: .RS +2 .nf # sed -i -e '/QUEUEOPTIONS=/ s,=.*,=false,' \e # -e '/ETRN_HOSTS=/ s,=.*,="srvA:clnt1:clnt2 srvB:clnt1:clnt2"' \e # -e '/OPTIONS=/ s,=.*,="-bs -X /var/tmp/sendmail.log",' \e # /etc/default/sendmail .in -2 .fi .RE .SH FILES .TP \fB/usr/lib/mail/cf/README\fR Describes \fBsendmail\fR configuration files. .SH SEE ALSO .LP \fBps\fR(1), \fBsendmail\fR(8), \fBinitctl\fR(8)