SENDMAILTM
INSTALLATION AND OPERATION GUIDE
Eric Allman
Gregory Neil Shapiro
Claus Assmann
Sendmail, Inc.
Version 1.21
For Sendmail Version 8.12
SendmailTM implements a general purpose internetwork mail routing facility under the UNIX® operating system. It is not tied to any one transport protocol -- its function may be likened to a crossbar switch, relaying messages from one domain into another. In the process, it can do a limited amount of message header editing to put the message into a format that is appropriate for the receiving domain. All of this is done under the control of a configuration file.
Due to the requirements of flexibility for sendmail, the configuration file can seem somewhat unap- proachable. However, there are only a few basic configurations for most sites, for which standard con- figuration files have been supplied. Most other configurations can be built by adjusting an existing config- uration file incrementally.
Sendmail is based on RFC 821 (Simple Mail Transport Protocol), RFC 822 (Internet Mail Headers Format), RFC 974 (MX routing), RFC 1123 (Internet Host Requirements), RFC 1413 (Identification server), RFC 1652 (SMTP 8BITMIME Extension), RFC 1869 (SMTP Service Extensions), RFC 1870 (SMTP SIZE Extension), RFC 1891 (SMTP Delivery Status Notifications), RFC 1892 (Multi- part/Report), RFC 1893 (Enhanced Mail System Status Codes), RFC 1894 (Delivery Status Notifica- tions), RFC 1985 (SMTP Service Extension for Remote Message Queue Starting), RFC 2033 (Local Message Transmission Protocol), RFC 2034 (SMTP Service Extension for Returning Enhanced Error Codes), RFC 2045 (MIME), RFC 2476 (Message Submission), RFC 2487 (SMTP Service Extension for Secure SMTP over TLS), RFC 2554 (SMTP Service Extension for Authentication), RFC 2821 (Simple Mail Transfer Protocol), RFC 2822 (Internet Message Format), RFC 2852 (Deliver By SMTP Service Extension), and RFC 2920 (SMTP Service Extension for Command Pipelining). However, since send- mail is designed to work in a wider world, in many cases it can be configured to exceed these protocols. These cases are described herein.
Although sendmail is intended to run without the need for monitoring, it has a number of features that may be used to monitor or adjust the operation under unusual circumstances. These features are described.
Section one describes how to do a basic sendmail installation. Section two explains the day-to-day information you should know to maintain your mail system. If you have a relatively normal site, these two sections should contain sufficient information for you to install sendmail and keep it happy. Section three has information regarding the command line arguments. Section four describes some parameters that may be safely tweaked. Section five contains the nitty-gritty information about the configuration file. This section is for masochists and people who must write their own configuration file. Section six describes
DISCLAIMER: This documentation is under modification.
Sendmail is a trademark of Sendmail, Inc.
Sendmail Installation and Operation Guide SMM:08-3 configuration that can be done at compile time. The appendixes give a brief but detailed explanation of a number of features not described in the rest of the paper.
|
There are two basic steps to installing sendmail. First, you have to compile and install the binary. If sendmail has already been ported to your operating system that should be simple. Second, you must build a run-time configuration file. This is a file that sendmail reads when it starts up that describes the mailers it knows about, how to parse addresses, how to rewrite the message header, and the settings of various options. Although the configuration file can be quite complex, a configuration can usually be built using an M4-based configuration language. Assuming you have the standard sendmail distribu- tion, see cf/README for further information. The remainder of this section will describe the installation of sendmail assuming you can use one of the existing configurations and that the standard installation parameters are acceptable. All path- names and examples are given from the root of the sendmail subtree, normally /usr/src/usr.sbin/send- mail on 4.4BSD-based systems. Continue with the next section if you need/want to compile sendmail yourself. If you have a run- ning binary already on your system, you should probably skip to section 1.2. 1.1. Compiling Sendmail All sendmail source is in the sendmail subdirectory. To compile sendmail, ``cd'' into the ./Build This will leave the binary in an appropriately named subdirectory, e.g., obj.BSD-OS.2.1.i386. It 1.1.1. Tweaking the Build Invocation You can give parameters on the Build command. In most cases these are only used when -L libdirs -I incdirs -E envar=value -c Create a new obj.* tree before running. -f siteconfig -S Skip auto-configuration. Build will avoid auto-detecting libraries if this is set. All Most other parameters are passed to the make program; for details see $BUILD- 1.1.2. Creating a Site Configuration File (This section is not yet complete. For now, see the file devtools/README for details.) 1.1.3. Tweaking the Makefile Sendmail supports two different formats for the local (on disk) version of databases, |
SMM:08-8 Sendmail Installation and Operation Guide
NDBM The ``new DBM'' format, available on nearly all systems around today. This
was the preferred format prior to 4.4BSD. It allows such complex things as
multiple databases and closing a currently open database.
|
NEWDB |
The Berkeley DB package. If you have this, use it. It allows long records, multiple open databases, real in-memory caching, and so forth. You can define this in conjunction with |
||
|
NDBM; if you do, old alias databases are read, |
|||
|
but when a new database is created it will be in NEWDB format. As a nasty hack, if you have NEWDB, NDBM, and NIS defined, and if the alias file name includes the substring ``/yp/'', sendmail will create both new and old versions of the alias file during a newalias command. This is required because the Sun NIS/YP system reads the DBM version of the alias file. It's ugly as sin, but it works. |
|
If neither of these are defined, sendmail reads the alias file into memory on every invocation. LDAP Lightweight Directory Access Protocol. NIS Sun's Network Information Services (formerly YP). NISPLUS Sun's NIS+ services. NETINFO NeXT's NetInfo service. HESIOD Hesiod service (from Athena). Other compilation flags are set in conf.h and should be predefined for you unless you are porting 1.1.4. Compilation and installation After making the local system configuration described above, You should be able to com- ./Build This will use uname(1) to create a custom Makefile for your environment. If you are installing in the standard places, you should be able to install using ./Build install This should install the binary in /usr/sbin and create links from /usr/bin/newaliases and ./Build install-set-user-id 1.2. Configuration Files Sendmail cannot operate without a configuration file. The configuration defines the mail deliv- The sendmail configuration can be daunting at first. The world is complex, and the mail con- Our configuration files are processed by m4 to facilitate local customization; the directory cf of cf Both site-dependent and site-independent descriptions of hosts. These can be lit- |
Sendmail Installation and Operation Guide SMM:08-9
general descriptions (such as ``generic-solaris2.mc'' as a general description of
an SMTP-connected host running Solaris 2.x. Files ending .mc (``M4 Configura-
tion'') are the input descriptions; the output is in the corresponding .cf file. The
general structure of these files is described below.
|
domain |
Site-dependent subdomain descriptions. These are tied to the way your organiza- tion wants to do addressing. For example, domain/CS.Berkeley.EDU.m4 is our description for hosts in the CS.Berkeley.EDU subdomain. These are referenced using the |
||
|
DOMAIN m4 macro in the .mc file. |
|||
|
feature |
Definitions of specific features that some particular host in your site might want. These are referenced using the |
||
|
FEATURE m4 macro. An example feature is |
|||
|
use_cw_file (which tells sendmail to read an /etc/mail/local-host-names file on startup to find the set of local names). |
|||
|
hack |
Local hacks, referenced using the |
||
|
HACK m4 macro. Try to avoid these. The |
|||
|
point of having them here is to make it clear that they smell. |
|||
|
m4 |
Site-independent m4(1) include files that have information common to all configu- ration files. This can be thought of as a ``#include'' directory. |
||
|
mailer |
Definitions of mailers, referenced using the |
||
|
MAILER m4 macro. The mailer types |
|||
|
that are known in this distribution are fax, local, smtp, uucp, and usenet. For example, to include support for the UUCP-based mailers, use ``MAILER(uucp)''. |
|||
|
ostype |
Definitions describing various operating system environments (such as the loca- tion of support files). These are referenced using the |
||
|
OSTYPE m4 macro. |
|||
|
sh siteconfig |
Shell files used by the m4 build process. You shouldn't have to mess with these. Local UUCP connectivity information. This directory has been supplanted by the mailertable feature; any new configurations should use that feature to do UUCP (and other) routing. The use of this directory is deprecated. |
|
If you are in a new domain (e.g., a company), you will probably want to create a cf/domain Subdomains at Berkeley are also represented in the cf/domain directory. For example, the You will have to use or create .mc files in the cf/cf subdirectory for your hosts. This is detailed 1.3. Details of Installation Files This subsection describes the files that comprise the sendmail installation. 1.3.1. /usr/sbin/sendmail The binary for sendmail is located in /usr/sbin1. It should be set-group-ID smmsp as |
described in sendmail/SECURITY. For security reasons, /, /usr, and /usr/sbin should be owned
1This is usually /usr/sbin on 4.4BSD and newer systems; many systems install it in /usr/lib. I understand it is in /usr/ucblib on System V Release 4.
SMM:08-10 Sendmail Installation and Operation Guide
by root, mode 07552.
|
1.3.2. /etc/mail/sendmail.cf This is the main configuration file for sendmail3. This is one of the two non-library file |
|
|
names compiled into sendmail4, the other is /etc/mail/submit.cf. |
|
|
The configuration file is normally created using the distribution files described above. If 1.3.3. /etc/mail/submit.cf This is the configuration file for sendmail when it is used for initial mail submission, in 1.3.4. /usr/bin/newaliases The newaliases command should just be a link to sendmail: rm -f /usr/bin/newaliases This can be installed in whatever search path you prefer for your system. 1.3.5. /usr/bin/hoststat The hoststat command should just be a link to sendmail, in a fashion similar to newaliases. 1.3.6. /usr/bin/purgestat This command is also a link to sendmail. It flushes expired (Timeout.hoststatus) informa- 1.3.7. /var/spool/mqueue The directory /var/spool/mqueue should be created to hold the mail queue. This directory The actual path of this directory is defined by the QueueDirectory option of the sendmail.cf |
ture while sendmail is running.
2Some vendors ship them owned by bin; this creates a security hole that is not actually related to sendmail. Other impor- tant directories that should have restrictive ownerships and permissions are /bin, /usr/bin, /etc, /etc/mail, /usr/etc, /lib, and /usr/lib.
3Actually, the pathname varies depending on the operating system; /etc/mail is the preferred directory. Some older sys- tems install it in /usr/lib/sendmail.cf, and I've also seen it in /usr/ucblib. If you want to move this file, add -D_PATH_SENDMAIL- CF=\"/file/name\" to the flags passed to the C compiler. Moving this file is not recommended: other programs and scripts know of this location.
4The system libraries can reference other files; in particular, system library subroutines that sendmail calls probably refer- ence /etc/passwd and /etc/resolv.conf.
Sendmail Installation and Operation Guide SMM:08-11
If these directories have subdirectories or symbolic links to directories named `qf', `df', and
`xf', then these will be used for the different queue file types. That is, the data files are stored in
the `df' subdirectory, the transcript files are stored in the `xf' subdirectory, and all others are
stored in the `qf' subdirectory.
|
If shared memory support is compiled in, sendmail stores the available diskspace in a 1.3.8. /var/spool/clientmqueue The directory /var/spool/clientmqueue should be created to hold the mail queue. This The actual path of this directory is defined by the QueueDirectory option of the submit.cf 1.3.9. /var/spool/mqueue/.hoststat This is a typical value for the HostStatusDirectory option, containing one file per host that 1.3.10. /etc/mail/aliases* The system aliases are held in ``/etc/mail/aliases''. A sample is given in ``send- cp sendmail/aliases /etc/mail/aliases You should extend this file with any aliases that are apropos to your system. Normally sendmail looks at a database version of the files, stored either in The permissions of the alias file and the database versions should be 0640 to prevent local 1.3.11. /etc/rc or /etc/init.d/sendmail It will be necessary to start up the sendmail daemon when your system reboots. This dae- If necessary, add the following lines to ``/etc/rc'' (or ``/etc/rc.local'' as appropriate) in the |
SMM:08-12 Sendmail Installation and Operation Guide
if [ -f /usr/sbin/sendmail -a -f /etc/mail/sendmail.cf ]; then
|
fi |
(cd /var/spool/mqueue; rm -f xf*) |
|
The ``cd'' and ``rm'' commands insure that all transcript files have been removed; extraneous Some people use a more complex startup script, removing zero length qf files and df files 1.3.12. /etc/mail/helpfile This is the help file used by the SMTP HELP command. It should be copied from ``send- cp sendmail/helpfile /etc/mail/helpfile The actual path of this file is defined in the HelpFile option of the sendmail.cf file. 1.3.13. /etc/mail/statistics If you wish to collect statistics about your mail traffic, you should create the file cp /dev/null /etc/mail/statistics This file does not grow. It is printed with the program ``mailstats/mailstats.c.'' The actual path 1.3.14. /usr/bin/mailq If sendmail is invoked as ``mailq,'' it will simulate the -bp flag (i.e., sendmail will print the 1.3.15. sendmail.pid sendmail stores its current pid in the file specified by the PidFile option (default is chmod 0600 /var/run/sendmail.pid 1.3.16. Map Files To prevent local denial of service attacks as explained in the top level README in the cd /etc/mail |
Sendmail Installation and Operation Guide SMM:08-13
|
#!/bin/sh |
|
done |
if [ -r $qffile ] |
# rename tf files to be qf if the qf does not exist
for tffile in tf*
|
do |
|||
|
qffile=`echo $tffile | sed 's/t/q/'` |
|||
|
done |
# remove df files with no corresponding qf files
for dffile in df*
|
do |
|||
|
qffile=`echo $dffile | sed 's/d/q/'` |
|||
|
done |
# announce files that have been saved during disaster recovery
for xffile in [A-Z]f*
|
do |
|||
|
if [ -f $xffile ] |
|||
|
done |
Figure 1 -- A complex startup script
2.1. The System Log
SMM:08-14 Sendmail Installation and Operation Guide
The system log is supported by the syslogd (8) program. All messages from sendmail are
logged under the LOG_MAIL facility5.
|
2.1.1. Format Each line in the system log consists of a timestamp, the name of the machine that gener- and a message6. Most messages are a sequence of name=value pairs. |
|
|
The two most common lines are logged when a message is processed. The first logs the from The envelope sender address. size The size of the message in bytes. class The class (i.e., numeric precedence) of the message. pri The initial message priority (used for queue sorting). nrcpts The number of envelope recipients for this message (after aliasing and for- msgid The message id of the message (from the header). proto The protocol used to receive this message (e.g., ESMTP or UUCP) daemon The daemon name from the DaemonPortOptions setting. relay The machine from which it was received. There is also one line logged per delivery attempt (so there can be several per message if deliv- to A comma-separated list of the recipients to this mailer. ctladdr The ``controlling user'', that is, the name of the user whose credentials we use delay The total delay between the time this message was received and the current xdelay The amount of time needed in this delivery attempt (normally indicative of the mailer The name of the mailer used to deliver to this recipient. relay The name of the host that actually accepted (or rejected) this recipient. dsn The enhanced error code (RFC 2034) if available. stat The delivery status. Not all fields are present in all messages; for example, the relay is usually not listed for local 2.1.2. Levels If you have syslogd (8) or an equivalent installed, you will be able to do logging. There is a |
purposes. Levels from 11-64 are reserved for verbose information that some sites might want.
5Except on Ultrix, which does not support facilities in the syslog.
6This format may vary slightly if your vendor has changed the syntax.
Sendmail Installation and Operation Guide SMM:08-15
A complete description of the log levels is given in section 4.7.
|
2.2. Dumping State You can ask sendmail to log a dump of the open files and the connection cache by sending it a SIGUSR1 signal. The results are logged at LOG_DEBUG priority. |
|
|
2.3. The Mail Queues Mail messages may either be delivered immediately or be held for later delivery. Held mes- A mail message may be queued for these reasons: · If a mail message is temporarily undeliverable, it is queued and delivery is attempted later. If 2.3.1. Queue Groups and Queue Directories There are one or more mail queues. Each mail queue belongs to a queue group. There is By default, a queued message is placed in the queue group associated with the first recipi- A message with multiple recipients will be split if different queue groups are chosen by the When a message is placed in a queue group, and the queue group has more than one If a message with multiple recipients is placed into a queue group with the 'r' option (maxi- Notice: if multiple queue groups are used, do not move queue files around, e.g., into a dif- 2.3.2. Queue Runs sendmail has two different ways to process the queue(s). The first one is to start queue |
SMM:08-16 Sendmail Installation and Operation Guide
discussed in the appendix ``COMMAND LINE FLAGS''. Persistent queue runners have the
advantage that no new processes need to be spawned at certain intervals; they just sleep for a
specified time after they finished a queue run. Another advantage of persistent queue runners is
that only one process belonging to a workgroup (a workgroup is a set of queue groups) collects
the data for a queue run and then multiple queue runner may go ahead using that data. This can
significantly reduce the disk I/O necessary to read the queue files compared to starting multiple
queue runners directly. Their disadvantage is that a new queue run is only started after all
queue runners belonging to a group finished their tasks. In case one of the queue runners tries
delivery to a slow recipient site at the end of a queue run, the next queue run may be substan-
tially delayed. In general this should be smoothed out due to the distribution of those slow jobs,
however, for sites with small number of queue entries this might introduce noticable delays. In
general, persistent queue runners are only useful for sites with big queues.
|
2.3.3. Manual Intervention Under normal conditions the mail queue will be processed transparently. However, you 2.3.4. Printing the queue The contents of the queue(s) can be printed using the mailq command (or by specifying the mailq This will produce a listing of the queue id's, the size of the message, the date the message 2.3.5. Forcing the queue Sendmail should run the queue automatically at intervals. When using multiple queues, a There is no attempt to insure that only one queue processor exists at any time, since there In some cases, you may find that a major host going down for a couple of days may create To do this, it is acceptable to move the entire queue directory: |
Sendmail Installation and Operation Guide SMM:08-17
cd /var/spool
|
mv mqueue omqueue; mkdir mqueue; chmod 0700 mqueue You should then kill the existing daemon (since it will still be processing in the old queue direc- To run the old mail queue, issue the following command: /usr/sbin/sendmail -C /etc/mail/queue.cf -q The -C flag specifies an alternate configuration file queue.cf which should refer to the moved O QueueDirectory=/var/spool/omqueue and the -q flag says to just run every job in the queue. You can also specify the moved queue /usr/sbin/sendmail -oQ/var/spool/omqueue -q but this requires that you do not have queue groups in the configuration file, because those are When the queue is finally emptied, you can remove the directory: rmdir /var/spool/omqueue 2.4. Disk Based Connection Information Sendmail stores a large amount of information about each remote system it has connected to Additionally enabling SingleThreadDelivery has the added effect of single-threading mail The disk based host information is stored in a subdirectory of the mqueue directory called .hoststat7. Removing this directory and its subdirectories has an effect similar to the purgestat |
|
|
command and is completely safe. However, purgestat only removes expired (Timeout.hoststatus) data. The information in these directories can be perused with the hoststat command, which will indicate the host name, the last access, and the status of that access. An asterisk in the left most column indicates that a sendmail process currently has the host locked for mail delivery. The disk based connection information is treated the same way as memory based connection information for the purpose of timeouts. By default, information about host failures is valid for 30 minutes. This can be adjusted with the Timeout.hoststatus option. The connection information stored on disk may be expired at any time with the purgestat |
command or by invoking sendmail with the -bH switch. The connection information may be
7This is the usual value of the HostStatusDirectory option; it can, of course, go anywhere you like in your filesystem.
SMM:08-18 Sendmail Installation and Operation Guide
viewed with the hoststat command or by invoking sendmail with the -bh switch.
|
2.5. The Service Switch The implementation of certain system services such as host and user name lookup is con- of such systems8. |
|
|
If the underlying operating system does not support a service switch (e.g., SunOS 4.X, HP- hosts dns files nis will ask sendmail to look for hosts in the Domain Name System first. If the requested host name is Notice: since sendmail must access MX records for correct operation, it will use DNS if it is hosts files dns will not avoid DNS lookups even if a host can be found in /etc/hosts. Service switches are not completely integrated. For example, despite the fact that the host 2.6. The Alias Database After recipient addresses are read from the SMTP connection or command line they are The alias database exists in two forms. One is a text form, maintained in the file name: name1, name2, ... Only local names may be aliased; e.g., eric@prep.ai.MIT.EDU: eric@CS.Berkeley.EDU will not have the desired effect (except on prep.ai.MIT.EDU, and they probably don't want me)9. |
|
|
Aliases may be continued by starting any continuation lines with a space or a tab or by putting a backslash directly before the newline. Blank lines and lines beginning with a sharp sign (``#'') are comments. The second form is processed by the ndbm (3)10 or the Berkeley DB library. This form is in |
|
|
the file /etc/mail/aliases.db (if using NEWDB) or /etc/mail/aliases.dir and /etc/mail/aliases.pag (if |
using NDBM). This is the form that sendmail actually uses to resolve aliases. This technique is
8HP-UX 10 has service switch support, but since the APIs are apparently not available in the libraries sendmail does not use the native service switch in this release.
9Actually, any mailer that has the `A' mailer flag set will permit aliasing; this is normally limited to the local mailer.
10The gdbm package does not work.
Sendmail Installation and Operation Guide SMM:08-19
used to improve performance.
|
The control of search order is actually set by the service switch. Essentially, the entry O AliasFile=switch:aliases is always added as the first alias entry; also, the first alias file name without a class (e.g., without ``nis:'' on the front) will be used as the name of the file for a ``files'' entry in the aliases switch. For example, if the configuration file contains O AliasFile=/etc/mail/aliases and the service switch contains aliases nis files nisplus then aliases will first be searched in the NIS database, then in /etc/mail/aliases, then in the NIS+ database. You can also use |
|
|
NIS-based alias files. For example, the specification: |
|
|
O AliasFile=/etc/mail/aliases will first search the /etc/mail/aliases file and then the map named ``mail.aliases'' in ``my.nis.domain''. Warning: if you build your own |
|
|
NIS-based alias files, be sure to provide the -l |
|
|
flag to makedbm(8) to map upper case letters in the keys to lower case; otherwise, aliases with upper case letters in their names won't match incoming addresses. Additional flags can be added after the colon exactly like a K line -- for example: O AliasFile=nis:-N mail.aliases@my.nis.domain will search the appropriate NIS map and always include null bytes in the key. Also: O AliasFile=nis:-f mail.aliases@my.nis.domain will prevent sendmail from downcasing the key before the alias lookup. 2.6.1. Rebuilding the alias database The hash or dbm version of the database may be rebuilt explicitly by executing the com- newaliases This is equivalent to giving sendmail the -bi flag: /usr/sbin/sendmail -bi If you have multiple aliases databases specified, the -bi flag rebuilds all the database types 2.6.2. Potential problems There are a number of problems that can occur with the alias database. They all result Sendmail has three techniques to try to relieve these problems. First, it ignores interrupts @: @ (which is not normally legal). Before sendmail will access the database, it checks to insure that |
SMM:08-20 Sendmail Installation and Operation Guide
this entry exists11.
|
2.6.3. List owners If an error occurs on sending to a certain address, say ``x'', sendmail will look for an alias unix-wizards: eric@ucbarpa, wnj@monet, nosuchuser, would cause ``eric@ucbarpa'' to get the error that will occur when someone sends to unix-wiz- List owners also cause the envelope sender address to be modified. The contents of the 2.7. User Information Database This option is deprecated, use virtusertable and genericstable instead as explained in 2.8. Per-User Forwarding (.forward Files) As an alternative to the alias database, any user may put a file with the name ``.forward'' in mckusick@ernie then any mail arriving for ``mckusick'' will be redirected to the specified accounts. Actually, the configuration file defines a sequence of filenames to check. By default, this is 2.9. Special Header Lines Several header lines have special interpretations defined by the configuration file. Others 2.9.1. Errors-To: If errors occur anywhere during processing, this header will cause error messages to go to The Errors-To: header was created in the bad old days when UUCP didn't understand the |
distinction between an envelope and a header; this was a hack to provide what should now be
11The AliasWait option is required in the configuration for this action to occur. This should normally be specified.
Sendmail Installation and Operation Guide SMM:08-21
passed as the envelope sender address. It should go away. It is only used if the UseErrorsTo
option is set.
|
The Errors-To: header is officially deprecated and will go away in a future release. 2.9.2. Apparently-To: RFC 822 requires at least one recipient field (To:, Cc:, or Bcc: line) in every message. If a The Apparently-To: header is non-standard and is both deprecated and strongly discour- 2.9.3. Precedence The Precedence: header can be used as a crude control of message priority. It tweaks the 2.10. IDENT Protocol Support Sendmail supports the IDENT protocol as defined in RFC 1413. Note that the RFC states a 6. Security Considerations The information returned by this protocol is at most as trustworthy as the host providing it OR The Identification Protocol is not intended as an authorization or access control protocol. At The use of the information returned by this protocol for other than auditing is strongly discour- An Identification server may reveal information about users, entities, objects or processes In some cases your system may not work properly with IDENT support due to a bug in the TCP/IP |
|
The complete list of arguments to sendmail is described in detail in Appendix A. Some important arguments are described here. 3.1. Queue Interval The amount of time between forking a process to run through the queue is defined by the -q RFC 1123 section 5.3.1.1 says that this value should be at least 30 minutes (although that Notice: the meaning of the interval time depends on whether normal queue runners or persis- 3.2. Daemon Mode If you allow incoming mail over an IPC connection, you should have a daemon running. This /usr/sbin/sendmail -bd -q30m An alternative approach is to invoke sendmail from inetd(8) (use the -bs -Am flags to ask /usr/sbin/sendmail -q30m 3.3. Forcing the Queue In some cases you may find that the queue has gotten clogged for some reason. You can /usr/sbin/sendmail -q -v You can also limit the jobs to those with a particular queue identifier, recipient, sender, or 3.4. Debugging There are a fairly large number of debug flags built into sendmail. Each debug flag has a cate- |
Sendmail Installation and Operation Guide SMM:08-23
debugging that particular piece of code.
|
You should never run a production sendmail server in debug mode. Many of the debug flags A debug category is either an integer, like 42, or a name, like ANSI. You can specify a range Debug flags are set using the -d option; the syntax is: debug-flag: -d debug-list where spaces are for reading ease only. For example, -d12 Set category 12 to level 1 For a complete list of the available debug flags you will have to look at the code and the TRACE- ident /usr/sbin/sendmail | grep Debug 3.5. Changing the Values of Options Options can be overridden using the -o or -O command line flags. For example, /usr/sbin/sendmail -oT2m sets the T (timeout) option to two minutes for this run only; the equivalent line using the long option /usr/sbin/sendmail -OTimeout.queuereturn=2m Some options have security implications. Sendmail allows you to set these, but relinquishes its set-user-ID or set-group-ID permissions thereafter12. |
|
|
3.6. Trying a Different Configuration File An alternative configuration file can be specified using the -C flag; for example, /usr/sbin/sendmail -Ctest.cf -oQ/tmp/mqueue uses the configuration file test.cf instead of the default /etc/mail/sendmail.cf. If the -C flag has no Sendmail gives up set-user-ID root permissions (if it has been installed set-user-ID root) when |
directory (QueueDirectory or Q option) while testing.
12That is, it sets its effective uid to the real uid; thus, if you are executing as root, as from root's crontab file or during system startup the root permissions will still be honored.
|
Many SMTP implementations do not fully implement the protocol. For example, some per- /usr/sbin/sendmail -X /tmp/traffic -bd will log all traffic in the file /tmp/traffic. This logs a lot of data very quickly and should NEVER be used during normal operations. 3.8. Testing Configuration Files When you build a configuration table, you can do a certain amount of testing using the ``test sendmail -bt -Ctest.cf which would read the configuration file ``test.cf'' and enter test mode. In this mode, you enter lines rwset address where rwset is the rewriting set you want to use and address is an address to apply the set to. Test 3,1,21,4 monet:bollard first applies ruleset three to the input ``monet:bollard.'' Ruleset one is then applied to the output of If you need more detail, you can also use the ``-d21'' flag to turn on more debugging. For sendmail -bt -d21.99 turns on an incredible amount of information; a single word address is probably going to print out You should be warned that internally, sendmail applies ruleset 3 to all addresses. In test mode 0 bruce@broadcast.sony.com This version requires that you use: 3,0 bruce@broadcast.sony.com As of version 8.7, some other syntaxes are available in test mode: .D x value defines macro x to have the indicated value. This is useful when debugging rules .C c value adds the indicated value to class c. =S ruleset dumps the contents of the indicated ruleset. -d debug-spec is equivalent to the command-line flag. Version 8.9 introduced more features: ? shows a help message. =M display the known mailers. $m print the value of macro m. |
Sendmail Installation and Operation Guide SMM:08-25
$=c print the contents of class c.
|
/mx host /parse address /try mailer addr /tryflags flags |
returns the MX records for `host'. parse address, returning the value of crackaddr, and the parsed address. rewrite address into the form it will have when presented to the indicated mailer. set flags used by parsing. The flags can be `H' for Header or `E' for Envelope, and `S' for Sender or `R' for Recipient. These can be combined, `HR' sets flags for header recipients. |
||
|
/canon hostname |
try to canonify hostname. |
|
/map mapname key /quit quit address test mode. 3.9. Persistent Host Status Information When HostStatusDirectory is enabled, information about the status of hosts is maintained on sendmail -bh This information may be flushed with the command: sendmail -bH Flushing the information prevents new sendmail processes from loading it, but does not prevent |
|
There are a number of configuration parameters you may want to change, depending on the requirements of your site. Most of these are set using an option in the configuration file. For example, the line ``O Timeout.queuereturn=5d'' sets option ``Timeout.queuereturn'' to the value ``5d'' (five days). Most of these options have appropriate defaults for most sites. Howev |