Chapter 2. Download, Build, and Install

In this chapter, we show you how to obtain the latest version of sendmail in source form, then how to build and install it yourself. Although this process can be simple, many decisions that can complicate it must be made ahead of time.

Vendor Versus Compiling

You may need to decide whether to compile sendmail from the source or to obtain it from a vendor. Very old versions of sendmail should be replaced because they are insecure. Newer versions should also be replaced because the latest version (V8.14) contains many new and valuable features.

Note that vendors tend to ship old versions of sendmail with their operating systems. Current versions of operating systems frequently ship V8.13 or V8.14 sendmail.

To find out which version you are running, issue the following command:[26]

% /usr/sbin/sendmail -d0.1 -bt < /dev/null

The first line (of possibly many) printed should contain the version number. If no version is displayed, you might be running a very old version of sendmail indeed, or some other program masquerading as sendmail. In either instance, you should upgrade.

If V8.9.2 or earlier is displayed, you should plan to upgrade. V8.9.3 was the last secure version of the V8.9 series.

If V8.11.5 or earlier is displayed, you should plan to upgrade. V8.11.6 was the last secure version of the V8.11 series.

A more difficult decision is whether to upgrade to V8.14 if you are already running V8.9.3 or V8.11.6 sendmail. Potential reasons for upgrading are described in the list that follows.

Security

The sendmail program has always been a prime target of attack by crackers (probably because it is distributed as fully commented source code). Although sendmail has been secure since V8.11.6, one of your C-language libraries might not be. If you have been notified of a security hole in your library, you should consider recompiling sendmail, using a new, secure library. You can do this only with the open source. Recompiling is not an option with vendor-supplied binaries.

Spam

If your site is beset by spam mailings (as most sites are these days), you should at least be running V8.9.3 sendmail with the access_db FEATURE support included and utilized (The access Database on page 277). The V8.9 release of sendmail was the first that specifically targeted the suppression of spam. If your site suffers from spam mailings, consider upgrading to V8.14 soon.

Bug fixes

After widespread use and abuse, any program will begin to show its bugs. The sendmail program, although superbly written, is no exception. One reason new versions are periodically released is to fix reported bugs. At the very least, down-load the latest source and look at the release notes to see whether a bug might be biting you.

Uniformity

At a heterogeneous site (as most sites are these days), it is often more convenient to run a common version of sendmail and clone configuration files. Only by compiling and installing from the source can you achieve a controllable level of uniformity.

Tuning

A precompiled version of sendmail can lack certain features that you find desirable, or it can have features that you would prefer to exclude. Table 3-2 (in To Port, Tune, or Debug on page 105) lists the debugging switches you can use to determine what kind of features your sendmail has available. If debugging switches are unavailable, the individual sections at the end of Chapter 3 show methods to determine feature support or the lack of it.

But beware. Before rushing out and replacing your vendor’s version of sendmail, find out whether it uses any special vendor-specific features. If so, and if those features are more valuable to you than the antispam features and uniformity that we mentioned, convince your vendor to upgrade for you.

Download the Source

The latest release of sendmail is available via:

http://www.sendmail.org/

When you download the source you must select a file appropriate to your needs from the many that are listed. In addition to selecting the version of sendmail you want, you must choose between two forms of compressed tar(1) distributions. Those that end in .Z are compressed with Unix compress(1); those that end in .gz are compressed with GNU gzip(1). The latter is the preferred form because the file is smaller and therefore quicker to transfer.

In addition to the two forms of distribution, each release has a PGP signature file associated with it.[27] Prior to V8.11, this was a single signature file used to verify the uncompressed file, meaning that you needed to uncompress the tar(1) file before verifying it. Beginning with V8.11, there is a signature file for each of the compressed files, so there is no need to uncompress either first.

The signature file has the same name as the distribution file but with a literal .sig suffix added.

sendmail.8.14.1.tar.gzthe distribution file
sendmail.8.14.1.tar.gz.sig      ← the signature file for this distribution file
sendmail.8.14.1.tar.Zthe distribution file
sendmail.8.14.1.tar.Z.sig       ← the signature file for this distribution file

If you have not already done so for an earlier sendmail distribution, you must now download and install the PGPKEYS file from sendmail.org:

ftp://ftp.sendmail.org/pub/sendmail/PGPKEYS

After downloading this file, add the keys in it to your PGP key ring with a command like this:

pgp -ka PGPKEYS          ← for pgp version 2.x
pgpk -a PGPKEYS          ← for pgp version 5.x
gpg --import PGPKEYS     ← for gpg

If you use gpg(1), your output may look something like this:

% gpg --import PGPKEYS
gpg: key 16F4CCE9: "Sendmail Security <sendmail-security@sendmail.org>" 22 new
signatures
gpg: key 7093B841: public key "Sendmail Signing Key/2007 <sendmail@Sendmail.ORG>"
imported
gpg: key AF959625: "Sendmail Signing Key/2006 <sendmail@Sendmail.ORG>" 7 new
signatures
gpg: key 1EF99251: "Sendmail Signing Key/2005 <sendmail@Sendmail.ORG>" 9 new
signatures
gpg: key 95F61771: "Sendmail Signing Key/2004 <sendmail@Sendmail.ORG>" 7 new
signatures
gpg: key 396F0789: "Sendmail Signing Key/2003 <sendmail@Sendmail.ORG>" 27 new
signatures
gpg: key 678C0A03: "Sendmail Signing Key/2002 <sendmail@Sendmail.ORG>" 13 new
signatures
gpg: key CC374F2D: "Sendmail Signing Key/2001 <sendmail@Sendmail.ORG>" 14 new
signatures
gpg: key E35C5635: "Sendmail Signing Key/2000 <sendmail@Sendmail.ORG>" 5 new
signatures
gpg: key A39BA655: "Sendmail Signing Key/1999 <sendmail@Sendmail.ORG>" 4 new
signatures
gpg: key D432E19D: "Sendmail Signing Key/1998 <sendmail@Sendmail.ORG>" 4 new
signatures
gpg: key 12D3461D: "Sendmail Signing Key/1997 <sendmail@Sendmail.ORG>" 4 new
signatures
gpg: key A0F8AA0C: public key "Sendmail, Inc. Security Officer
<security-officer@sendmail.com>" imported
gpg: key BF7BA421: "Eric Allman <eric@allman.name>" 4 new user IDs
gpg: key BF7BA421: "Eric Allman <eric@allman.name>" 44 new signatures
gpg: key A00E1563: "Gregory Neil Shapiro <gshapiro@sendmail.com>" 48 new signatures
gpg: key 22327A01: "Claus Assmann (PGP2) <ca+pgp2@Sendmail.ORG>" 14 new signatures
gpg: Total number processed: 15
gpg:               imported: 1
gpg:           new user IDs: 4
gpg:         new signatures: 222
gpg: 3 marginal(s) needed, 1 complete(s) needed, classic trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u

Notice that the newest key imported in the preceding output was key 7093B841 (the signing key for 2007). To verify that this key is valid (not forged) print its fingerprint with a command like this:

% gpg --fingerprint 7093B841
pub  1024R/7093B841 2006-12-16
     Key fingerprint = D9 FD C5 6B EE 1E 7A A8  CE 27 D9 B9 55 8B 56 B6
uid                  Sendmail Signing Key/2007 <sendmail@Sendmail.ORG>

Now compare the fingerprint displayed to the following list of valid fingerprints:

18 A4 51 78 CA 72 D4 A7  ED 80 BA 8A C4 98 71 1D   ← Sendmail Security
CA AE F2 94 3B 1D 41 3C  94 7B 72 5F AE 0B 6A 11   ← 1997
F9 32 40 A1 3B 3A B6 DE  B2 98 6A 70 AF 54 9D 26   ← 1998
25 73 4C 8E 94 B1 E8 EA  EA 9B A4 D6 00 51 C3 71   ← 1999
81 8C 58 EA 7A 9D 7C 1B  09 78 AC 5E EB 99 08 5D   ← 2000
59 AF DC 3E A2 7D 29 56  89 FA 25 70 90 0D 7E C1   ← 2001
7B 02 F4 AA FC C0 22 DA  47 3E 2A 9A 9B 35 22 45   ← 2002
C4 73 DF 4A 97 9C 27 A9  EE 4F B2 BD 55 B5 E0 0F   ← 2003
46 FE 81 99 48 75 30 B1  3E A9 79 43 BB 78 C1 D4   ← 2004
4B 38 0E 0B 41 E8 FC 79  E9 7E 82 9B 04 23 EC 8A   ← 2005
18 A4 51 78 CA 72 D4 A7  ED 80 BA 8A C4 98 71 1D   ← 2006
E3 F4 97 BC 9F DF 3F 1D  9B 0D DF D5 77 9A C9 79   ← 2006
D9 FD C5 6B EE 1E 7A A8  CE 27 D9 B9 55 8B 56 B6   ← 2007

If the fingerprint for a downloaded PGPKEYS file does not match one in this list (for the correct year it represents), do not trust that file.

Note that once you have added a good PGPKEYS file to your key ring, you may execute the following command to verify the integrity and authenticity of any new source distribution you download.

pgp signature-file distribution-filefor pgp version 2.x
pgpv signature-file distribution-filefor pgp version 5.x
gpg --verify signature-file distribution-filefor gpg

If the tar file is good, gpg(1) will report that the signature is valid. For example:

% gpg --verify sendmail.8.14.1.tar.gz.sig sendmail.8.14.1.tar.gz
gpg: Signature made Tue Jan 09 12:11:36 2007 PST using RSA key ID 7093B841
gpg: Good signature from "Sendmail Signing Key/2007 <sendmail@Sendmail.ORG>"
Primary key fingerprint: D9 FD C5 6B EE 1E 7A A8  CE 27 D9 B9 55 8B 56 B6

Here the phrase Good signature means that the distribution file is good and was not modified after it was signed. As an additional precaution, make sure the fingerprint displayed matches one of the official fingerprints shown earlier.

In addition to the good output just shown, you may also get occasional warnings about your own setup. For example, the following warns about your local gpg(1) setup, not about the validity of the distribution:[28]

gpg: checking the trustdb
gpg: checking at depth 0 signed=0 ot(-/q/n/m/f/u)=0/0/0/0/0/1
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.

If verification fails, check for these possible errors:

  • Signature and tar(1) files must match each other’s versions. Transfer them again, this time with matching versions.

  • When transferring the files with ftp(1), you must be sure to use binary mode. Transfer them again, this time with the correct mode.

  • A presumed mirror FTP site might not be as official as you expect. If a secondary distribution fails to verify, get the official distributions from the official site shown earlier.

  • The official distribution might appear bad. If it fails to verify, first check that your copy of PGP was correctly installed, then make sure your network connection is clean and that it has not been compromised. If all else fails (including getting the distribution anew as explained earlier), describe your problem to the folks at .

Above all else, remember that if your copy of the sendmail distribution fails to verify, don’t use it!

What’s Where in the Source

V8.14 sendmail unpacks by creating a directory, then unpacking into that directory. The directory name is the same as the compressed filename but with a dash instead of the first dot.

% gzcat sendmail.8.14.1.tar.gz | tar xvf -
x sendmail.8.14.1/FAQ, 321 bytes, 1 tape blocks
x sendmail.8.14.1/INSTALL, 1396 bytes, 3 tape blocks
x sendmail.8.14.1/KNOWNBUGS, 8770 bytes, 18 tape blocks
... and so on

Inside the newly created directory, you will find the full sendmail distribution:

% cd sendmail.8.14.1
% ls
Build           README          include         makemap
FAQ             RELEASE_NOTES   libmilter       praliases
INSTALL         cf              libsm           rmail
KNOWNBUGS       contrib         libsmdb         sendmail
LICENSE         devtools        libsmutil       smrsh
Makefile        doc             mail.local      test
PGPKEYS         editmap         mailstats       vacation

The README and RELEASE_NOTES files provide the most up-to-date information about changes, new features, and bug fixes. Read the documents in the doc directory. Also note that the README files in all the subdirectories contain important comments as well.

The files and directories in the source directory are listed in Table 2-1, and are described in detail in the sections that follow.

Table 2-1. Files and directories in the distribution directory

File/Directory

§

Description

Build

The Top-Level Build Script on page 47

A top-level Build script

cf

Configure with m4 on page 587

Top of the tree for building a configuration file

contrib

The contrib Directory on page 47

Unsupported, user-contributed software

devtools

The devtools Directory on page 47

Top of the tree for build support tools

doc

The doc Directory on page 48

Current and background documentation

editmap

The editmap Program on page 354

Edit db entries

FAQ

 

See http://www.sendmail.org/faq/

include

The include Directory on page 48

Header files common to all programs

INSTALL

The INSTALL File on page 48

An overview of how to build and install sendmail

KNOWNBUGS

The KNOWNBUGS File on page 48

Tough problems that remain unfixed

libmilter

The libmilter Directory on page 49

Library used to create a multithreaded filter

libsm

The libsm Directory on page 49

Library routines used to build sendmail and its companion programs

libsmdb

The libsmdb Directory on page 50

Database library used by some programs

libsmutil

The libsmutil Directory on page 50

A library of utilities used by all programs

LICENSE

The LICENSE File on page 50

Terms for using the source and programs

mail.local

The mail.local Delivery Agent on page 359

Source tree for the mail.local program

mailstats

The mailstats Program on page 364

Source tree for the mailstats program

Makefile

The Makefile File on page 50

A top-level way to build everything

makemap

The makemap Program on page 370

Source tree for the makemap program

PGPKEYS

The PGPKEYS File on page 51

Keys to validate the sendmail source distribution

praliases

The praliases Program on page 376

Source tree for the praliases program

README

The README File on page 51

The top-level guide to what is where

RELEASE_NOTES

The RELEASE_NOTES File on page 51

A comprehensive history of sendmail changes

rmail

The rmail Delivery Agent on page 378

Source tree for the rmail program

sendmail

Download the Source on page 42

Source tree for the sendmail program

smrsh

The smrsh Program on page 379

Source tree for the smrsh program

test

The test Directory on page 53

Source tree for some security checks

vacation

The vacation Program on page 382

Source tree for the vacation program

The Top-Level Build Script

The top-level Build script can be used to do a global build across all programs. For example, you can do this to build all the programs:

% ./Build

All the commands you can use with the master Build (The Build Script on page 346) are available to this Build.

The contrib Directory

The contrib directory contains user-contributed and unsupported code. Among its contents are perl(1) scripts, shell scripts, C-language source code, and patches. The README file in this directory explains some of the policy surrounding the programs. For more complete information you will need to dig through the source files yourself.

If you have software that you would like to see included in this directory, email a description of that program to .

The devtools Directory

The devtools directory contains all the scripts and m4(1) source used to build sendmail and its libraries and companion programs. The README file there briefly describes the m4 macros used to configure your build process. We describe the current macros in Compile-Time Macro Reference on page 108. You should consult this file whenever a new release is issued because it will always have the most up-to-date information.

The devtools/Site directory is the default location for your m4 build configuration files. The README in that directory describes the strategy used to locate a build configuration file. Note that the -f command-line switch (-f on page 350) for the Build command can override use of that directory. Also note that the -Q command-line switch (-Q on page 352) for the Build command modifies the way an m4 file is found.

The doc Directory

The doc directory contains only one subdirectory, op. The doc/op directory contains the sendmail “INSTALLATION AND OPERATION GUIDE.” That guide is supplied in troff(1) source (op.me), and as a ready-to-print PostScript document (op.ps).

This is the main document distributed with sendmail that describes that program. It is succinct, and it is always a good place to start for a quick but detailed overview.

The include Directory

The include directory contains four subdirectories. The include/libsmdb directory contains files that support the use of the libsmdb library of common database routines. The include/sendmail directory contains files useful for sendmail and for programs that share the sendmail definitions and declarations (for example, the mailstats program). The include/libmilter directory contains files that support use of the libmilter library of routines. The include/sm directory contains files that support use of the libsm library of routines.

The INSTALL File

The INSTALL file contains a brief list of steps for compiling and installing sendmail.

The KNOWNBUGS File

The KNOWNBUGS file contains a (not always up-to-date) list of the most difficult bugs to fix in the sendmail program. Presence of this file ought not suggest that sendmail is distributed with bugs. Rather, it should assure you that reported bugs are admitted to and dealt with.

If you encounter behavior with sendmail that appears to be a bug in sendmail and not in another program, document that bug carefully so that it can be repeated, then find the email address to which to submit your report at http://www.sendmail.org/support/.

If you encounter a security problem with sendmail, use the fingerprint and public key stored in the PGPKEYS file to encrypt a message before submitting a report. Always try to avoid sending security-related email in clear text.

The libmilter Directory

The sendmail folks have defined a mail filter API[29] called Milter. Using this API, third-party programmers (you, for example) can design programs to access mail messages as they are being processed by sendmail. Such real-time access allows email message content to be filtered and possibly rejected based on content—a potentially powerful antispam tool.

The README file in this directory describes the steps needed to design, compile, and run such a filter. But beware. The use of this API and creation of a filter program require the use of POSIX threads. If your OS lacks POSIX thread support, you will not be able to use this API.

For systems that support POSIX threads, we illustrate the creation and use of a mail filter program in Chapter 26 on page 1169.

The libsm Directory

To support many of the new features in sendmail, and to pave the way for more sophisticated versions in the future, the designers of sendmail decided to create a replacement for many of the routines in the standard C library. A quick glance at the libsm directory will reveal replacements, for example, of fput(3) and ungetc(3).

A library of these routines is built and used by sendmail automatically when you build that program. You need do nothing special here.

In the rare event that you need to port sendmail to an entirely new operating system, you will need to study the file README in the libsm directory, and examine (and perhaps tweak) some of the various C source files there.

Prior to V8.14, whenever sendmail was built, the various checks in the libsm directory were also built and executed. Beginning with V8.14, these checks are no longer automatically run. Instead, you must run them by hand using the following commands:

% cd libsm
% make -s checka great deal of output here
===================
All 18 tests passed
===================

Here, the -s switch was used with make(1) to suppress most of the compiler invocation lines. The check caused all the tests to be built and executed. The last three lines show that all the tests succeeded. If any of the tests fail on your operating system, examine the test output to see what went wrong. Perhaps you will need to define or undefine a build-time macro (Build m4 Macro Reference on page 69). For example, if the test hung like this:

This test takes about 8 seconds.
If it takes longer than 30 seconds, please interrupt it
and compile again without semaphore support, i.e.,-DSM_CONF_SEM=0

you would need to undefine SM_CONF_SEM (SM_... on page 139) and rebuild.

The libsmdb Directory

The libsmdb directory contains source for a library that supports opening, reading, writing, searching, and closing database files. The types of database files supported are Berkeley db (versions 1, 2, and 3), btree and hash, and ndbm. This library is used by makemap, praliases, editmap, and vacation.

The libsmutil Directory

The libsmutil directory contains source for a library of routines that are useful to sendmail and its companion programs. Among the routines is support for debugging with -d (The Syntax of -d on page 530), the checking of safe files and directories (-d44.4 on page 569), and other useful tasks.

The LICENSE File

The LICENSE file contains the legal jargon surrounding how, when, and why you can use the source and the programs produced by that source. It also includes instructions on how to get updated license information.

The Makefile File

The top-level Makefile file can be used to globally compile all the programs in the distribution. It uses two environment variables: CONFIG and FLAGS. These can either be put into make’s environment as part of its command line, or put into your shell’s environment. The first technique is used when you wish to condition one of these variables just once or so. The second is useful when a variable setting is needed over and over during a prolonged development session.

The first technique looks like this:

% make CONFIG="-Q Server" FLAGS="-c"

Here, the CONFIG variable is used to set the location for your m4 build file, and the FLAGS variable is used to pass any other command-line switches you need to the Build program.

The second technique begins by conditioning your shell’s environment variables:

setenv CONFIG "-Q Server"                  ← the C shell and derivatives
CONFIG="-Q Server" ; export CONFIG         ← the Bourne shell and derivatives
setenv FLAGS "-c"                          ← the C shell and derivatives
FLAGS="-c" ; export FLAGS                  ← the Bourne shell and derivatives

You will see the result of declaring these two environment variables when you run the make(1) program, this time without having to specify those two variables in the command line:

% make all

See The Build Script on page 346 for an overview of how Build works, and what the -c and -Q switches do.

The PGPKEYS File

The PGPKEYS file contains the keys used to validate the authenticity of the sendmail distribution. To use them, however, you first need to unpack the distribution, then run pgp on the uncompressed tar file. This might give you the impression of safety, but be aware that a fake distribution can contain fake keys in a fake PGPKEYS file, and the fake PGPKEYS file will verify the fake distribution.

See Download the Source on page 42 for a description of the better way to validate your sendmail distribution.

The README File

The README file’s name should encourage you to do just what it says. Read that file whenever you download a fresh distribution. It contains lots of useful and up-to-date information.

The RELEASE_NOTES File

Each release of sendmail is packaged with a file called RELEASE_NOTES, located in the top level of the source distribution. The RELEASE_NOTES file itemizes new features that have been added to each particular version of sendmail since version 8.1 (released in 1993). This file is very complete but, on the downside, can be difficult to parse.

Basically, the RELEASE_NOTES file is divided into sections, each of which deals with a separate release of sendmail. Each begins with a single line that contains the version number of the sendmail release, followed by a slash, followed by the version number of the configuration file release, followed by the date of the release. For example:

8.14.1/8.14.1  2007/04/03

Here, the second release of the V8.14 series (8.14.1) is indicated.[30] The version and date are followed by sections that each document a change in the sendmail binary. Some sections are prefixed with a keyword and colon. For the most part, those keyword sections describe a change in something other than the binary[31] and, for example, can look like this:

SECURITY: Some security matter was fixed, and the description of
        that fix will appear here.
This item describes a change made to the sendmail binary.
LIBMILTER: This documents a change made to one of the files in the
        libmilter directory.

The keywords and the meaning of each are shown in Table 2-2.

Table 2-2. RELEASE_NOTES file keywords

Keyword

Description

SECURITY:

This type of information is usually very important. You should read it first thing, as it contains information about a security matter and may involve some vital action.

NOTICE:

This documents something you need to be aware of, usually an important change that might otherwise be overlooked.

none

This item documents the sendmail binary.

CONFIG:

A change in the configuration file (located in the cf directory).

CONTRIB:

A change in one of the programs in the contrib directory.

DEVTOOLS:

A change in how things are built (located in the devtools directory).

LIBMILTER:

A change in the Milter library (located in the libmilter directory).

LIBSM

A change in the sendmail library (located in the libsm directory).

LIBSMDB:

A change in the database library (located in the libsmdb directory).

LIBSMUTIL:

A change in the sendmail utilities library (located in the libsmutil directory).

DOC:

These documents are updated each release, so there is normally no need to indicate changes here. (See the doc directory.)

EDITMAP:

A change in the editmap(8) program or its manual (located in the editmap directory).

MAIL.LOCAL:

A change in the mail.local(8) program or its manual (located in the mail.local directory).

MAILSTATS:

A change in the mailstats(8) program or its manual (located in the mailstats directory).

MAKEMAP:

A change in the makemap(8) program or its manual (located in the makemap directory).

PRALIASES:

A change in the praliases(8) program or its manual (located in the praliases directory).

RMAIL:

A change in the rmail(8) program or its manual (located in the rmail directory).

SMRSH:

A change in the smrsh(8) program or its manual (located in the smrsh directory).

VACATION:

A change in the vacation(1) program or its manual (located in the vacation directory).

New Files:

The path to brand-new files.

Renamed Files:

The old and new names for renamed files.

Copied Files:

A new file has been added by copying an existing file.

Deleted Files:

Obsolete files that have been removed.

Changed Files:

Files whose attributes have changed (such as file permissions).

The test Directory

The test directory contains C-language programs that help the development team at sendmail.com solve problems concerning the porting of sendmail to other architectures. They are of interest only if you intend to port sendmail to a currently unsupported platform. Each .c file is somewhat self-documenting.

Build sendmail

Before building sendmail, leap ahead to Chapter 3 on page 103 and review the many #define macros defined there. Consider those marked as tune. If you find any that are important to you, include a definition for each in your m4 build file.

When your m4 build file is complete, return here. Next you will build sendmail by running the Build script.

The Build Script

The first step in compiling sendmail is to establish an object directory and a Makefile that is appropriate to your machine architecture and operating system. You do this by running the Build script in the sendmail source directory:[32]

% cd sendmail
% ./Build -n
Configuration: pfx=, os=SunOS, rel=4.1.4, rbase=4, rroot=4.1, arch=sun4, sfx=
Using M4=/usr/5bin/m4
Creating ../obj.SunOS.4.1.4.sun4/sendmail using ../devtools/OS/SunOS    ← many more
lines here
%

Here, Build found that our machine was a sun4, running the SunOS 4.1.4 release of Unix. Build then created the working directory ../obj.SunOS.4.1.4.sun4, set up symbolic links to all the source files in that directory, and finally generated a Makefile there.

The Build program understands several command-line switches that can be used to modify its behavior (see Table 2-3). Any switch or other command-line argument that is not in that table is carried through and passed as is to the make(1) program. For example, specifying the -n switch to Build (in the earlier example) caused Build to pass that switch to make(1), thereby preventing make(1) from actually building sendmail.

Table 2-3. Build command-line switches

Switch

§

Description

-A

-A on page 348

Show the architecture for the build.

-c

-c on page 348

Clean out an existing object tree.

-E

-E on page 349

Pass environment variables to build.

-f

-f on page 350

Use site file in alternative directory.

-I

-I on page 350

Add additional include directories.

-L

-L on page 351

Add additional library directories.

-m

-m on page 351

Show but don’t create the directory.

-M

-M on page 351

Show the name of the object directory.

-O

-O on page 352

Specify the path of the object directory.

-Q

-Q on page 352

Set prefix for the object directory and Build m4 configuration file.

-S

-S on page 353

Skip system-specific configuration.

Build with m4

The make(1) program[33] is used to compile and install sendmail. The Build script creates not only an object working directory, but also an appropriate Makefile in that directory using m4(1). Unless you tell Build to do otherwise, the Makefile it creates will be based solely on information it finds in the appropriate devtools/OS and devtools/Site subdirectories.

For most sites, this default behavior will produce the desired result. For other sites, different defaults are needed.

In this section, we discuss those m4 directives necessary for building a Makefile. To understand m4(1), leap ahead to Chapter 17 on page 584, review the information there, then return here.

Creating a Makefile with Build is simplicity itself. First decide whether you wish to maintain your m4 file inside the sendmail source tree, or outside it. If you choose to maintain your m4 file inside the source tree, just name it devtools/Site/site.config.m4 (see Build sendmail on page 53 for details) and run Build like this:

% ./Build

Note that here we have chosen to maintain all our Build m4 files inside the sendmail source tree. This approach allows administrators to rebuild sendmail without needing to remember where the m4 file is located.

If you choose to maintain your m4 file outside the source tree, use the -f command-line switch with Build to specify the location of that file:

% ./Build -f /usr/local/configs/sendmail/oursite.m4

Note that here we have chosen to maintain all our Build m4 files in a directory that is outside the sendmail distribution. This approach allows you to upgrade to new releases of sendmail without having to remember to copy the devtools/Site directory each time. The downside to this approach is that you must remember to use the -f command-line switch every time you build. If you fail to remember, or if someone else builds without knowing the need for -f, the created sendmail binary may not work as you expect or might lack the abilities you require.

Your m4 file is built using the directives shown in Table 2-4, which are described more fully in the sections that follow. One example of an m4 file might look like this:

define(`confOPTIMIZE', `-g')
define(`confENVDEF', `-DMATCHGECOS=0')
APPENDDEF(`confMAPDEF', `-DNIS')

Here we compile with -g to help debug new code we added, and with -DMATCHGECOS=0 to turn off support for fuzzy name matching (MATCHGECOS on page 120). Then we declare that we want to use nis(3) for aliases (with -DNIS).

Table 2-4. Build m4 directives

Directive

§

Description

[a]

APPENDDEF( )

APPENDDEF( ) on page 69

Append to an existing define.

confBEFORE

confBEFORE on page 70

Establish files before compiling.

confBLDVARIANT

confBLDVARIANT on page 71

Control variations on objects.

confBUILDBIN

confBUILDBIN on page 72

Location of devtools/bin.

confCC

confCC on page 72

The compiler with which to build sendmail.

confCCLINK

confCCLINK on page 73

The linker to use if confCC is inappropriate (V8.14 and later).

confCCOPTS

confCCOPTS on page 73

Command-line switches to pass to the compiler.

confCCOPTS_SO[a]

confCCOPTS_SO on page 73

Command-line switches for shared-library objects.

confCOPY

confCOPY on page 73

The copy command to use.

confDEPEND_TYPE

confDEPEND_TYPE on page 73

How to build Makefile dependencies.

confDEPLIBS

confDEPLIBS on page 74

Shared object dependencies.

confDONT_INSTALL_CATMAN

confDONT_INSTALL_CATMAN on page 74

Don’t install preformatted manual pages.

confEBINDIR

confEBINDIR on page 75

Bin directory for mail.local and smrsh.

confENVDEF

confENVDEF and conf_prog_ENVDEF on page 75

Pass -D switches during compilation.

conf_prog_ENVDEF

confENVDEF and conf_prog_ENVDEF on page 75

Pass -D switches during compilation.

confFORCE_RMAIL

confFORCE_RMAIL on page 76

Install the rmail program no matter what.

confGBIN...

confGBIN... on page 76

The set-group-id settings.

confHFDIR

confHFDIR on page 77

Where to install the sendmail help file.

confHFFILE

confHFFILE on page 78

The name of the sendmail help file.

confINCDIRS

confINCDIRS on page 78

Compiler -I switches.

confINC...

confINC... on page 78

Permissions and locations for installed #include files.

confINSTALL

confINSTALL on page 79

Program to install programs and files.

confINSTALL_RAWMAN

confINSTALL_RAWMAN on page 79

Install unformatted manuals.

confLD

confLD on page 80

The linker to use.

confLDOPTS

confLDOPTS on page 80

Linker options.

confLDOPTS_SO[a]

confLDOPTS_SO on page 80

Linker options for creating a shared library.

confLIB...

confLIB... on page 81

Location and modes for installed library files.

confLIBDIRS

confLIBDIRS on page 82

Linker -L switches.

confLIBS

confLIBS and conf_prog_LIBS on page 82

Linker -l libraries.

conf_prog_LIBS

confLIBS and conf_prog_LIBS on page 82

Linker -l libraries.

confLIBSEARCH

confLIBSEARCH on page 82

Automatic library search.

confLIBSEARCHPATH

confLIBSEARCHPATH on page 83

Paths to search for libraries.

confLINKS

confLINKS on page 84

What to link to sendmail.

confLN

confLN on page 83

Program to link files.

confLNOPTS

confLNOPTS on page 84

Switches for the program to link files.

confMAN...

confMAN... on page 85

How to install manual pages.

confMAPDEF

confMAPDEF on page 88

Which database libraries to use.

confMBIN...

confMBIN... on page 89

Where and how to install sendmail.

confMKDIR

confMKDIR on page 90

Program to create installation directories (V8.14 and later).

confMSPQOWN

confMSPQOWN on page 91

Owner of the MSP queue.

confMSP_QUEUE_DIR

confMSP_QUEUE_DIR on page 91

Location of the MSP queue.

confMSP_STFILE

confMSP_STFILE on page 91

Define MSP statistics file.

confMTCCOPTS[a]

confMTCCOPTS on page 92

Compiler options for multithreading.

confMTLDOPTS[a]

confMTLDOPTS on page 92

Linker options for multithreading.

confNO_HELPFILE_INSTALL

confNO_HELPFILE_INSTALL on page 92

Prevent installation of the help file.

confNO_MAN_BUILD

confNO_MAN_BUILD on page 92

Prevent formatting of manuals.

confNO_MAN_INSTALL

confNO_MAN_INSTALL on page 93

Prevent installation of manuals.

confNO_STATISTICS_INSTALL

confNO_STATISTICS_INSTALL on page 93

Prevent installation of the statistics file.

confNROFF

Program and arguments used for formatting on page 88

Program to format the manual pages.

confOBJADD

confOBJADD on page 93

Extra .o files to be linked in all programs.

confOPTIMIZE

confOPTIMIZE on page 94

How to optimize the compiler.

confRANLIB

confRANLIB on page 94

The ranlib program for library archive files.

confRANLIBOPTS

confRANLIBOPTS on page 94

Arguments to give the ranlib program.

confREQUIRE_LIBSM

confREQUIRE_LIBSM on page 95

Define if libsm is required.

confSBINDIR

confSBINDIR on page 95

root-oriented program directory.

confSBINGRP

confSBINGRP on page 95

Group for set-user-id programs.

confSBINMODE

confSBINMODE on page 95

Permissions for set-user-id programs.

confSBINOWN

confSBINOWN on page 96

Owner for set-user-id programs.

confSHAREDLIB...

confSHAREDLIB... on page 96

Shared library definitions.

confSHELL

confSHELL on page 96

SHELL= for Makefile.

confSM_OS_HEADER

confSM_OS_HEADER on page 96

Platform-specific #include file.

confSMOBJADD

confSMOBJADD on page 97

Extra .o files to be linked in sendmail.

confSMSRCADD

confSMSRCADD on page 97

Source .c files corresponding to confSMOBJADD.

confSONAME

confSONAME on page 97

Shared object ID flag.

conf_prog_SRCADD

conf_prog_SRCADD on page 97

Extra .o files to be linked per program.

conf_prog_OBJADD

conf_prog_OBJADD on page 97

.c files corresponding to conf_prog_OBJADD.

confSRCADD

conf_prog_SRCADD on page 97

Source for confOBJADD files.

confSRCDIR

confSRCDIR on page 98

Location of sendmail source.

confSTDIOTYPE

confSTDIOTYPE on page 98

Use torek for buffered file I/O (V8.10 and earlier).

confSTDIR

confSTDIR on page 99

Location of the statistics file.

confSTFILE

confSTFILE and confSTMODE on page 99

Name of the statistics file.

confSTMODE

confSTFILE and confSTMODE on page 99

Name of the statistics file.

confSTRIP

confSTRIP on page 100

Name of the program to strip the binary.

confSTRIPOPTS

confSTRIPOPTS on page 100

Command-line arguments for the strip program.

confUBINDIR

confUBINDIR on page 100

Location of user executables.

confUBINGRP

confUBINGRP on page 101

Group for user executables.

confUBINMODE

confUBINMODE on page 101

Permissions for user executables.

confUBINOWN

confUBINOWN on page 101

Ownership of user executables.

PREPENDDEF( )

PREPENDDEF( ) on page 102

Prepend to an existing define.

[a] a These macros are not part of the open source distribution, but are mentioned in devtools/README.

Before creating your own m4 files, be sure to read devtools/README. That file always contains the latest information about building sendmail with m4(1).

Run Build

After you have finished configuring your m4 build file, you are ready to build sendmail. First run the following command in the sendmail source directory:

# ./Build -f /path/to/your/m4/file -n

This command first creates the obj directory in which sendmail will be built, populates that directory with symbolic links, and places a configured Makefile there. It then displays all the commands that make will generate without actually executing them.

If you are building a plain vanilla sendmail, or if you have placed your m4 file in the devtools/Site directory, you can omit the -f and the path to your m4 build file. If you wish to tune sendmail to your custom needs first, before running Build, you need to create an m4 file (as discussed earlier).

You can create your Build m4 files either outside the sendmail distribution or inside a special directory inside the distribution. If you maintain them outside, you will have to use the -f switch each time you build, but will avoid having to copy them again for each release of sendmail.

If you create a special file inside the devtools/Site directory, that file will be included without the need for an -f. The name of the file is site.config.m4. If you want to maintain several master files in that directory, you can do so depending on your operating system type. When Build runs, it prints a line that looks like the following, split to fit the page:

Configuration: pfx=, os=SunOS, rel=4.1.4, rbase=4, rroot=4.1, arch=sun4, sfx=,variant=
optimized

Here, the name of the operating system is printed following the os=. If you were to create a file in the devtools/Site directory called site.SunOS.m4, it, too, would be automatically found and used without the need for an -f switch.

If you have defined the environment variable SENDMAIL_SUFFIX, the sfx= will be assigned that value with a dot in front of it. That value can be used to further tune the name of the files in devtools/Site. For example, if SENDMAIL_SUFFIX is defined as server, the Build script will find and use a file called site.SunOS.server.m4.

The devtools/Site directory is first searched for the literal name site.config.m4. If that is not found, it is searched for the file named site.os=sfx=.m4, and after that for the file named site.os=.m4.

If all looks well after you have run Build with an -n, you can run it again, this time without the -n.

If You Change Your m4 Build File

After you run Build, you will likely find that you need to change one or more items in your m4 build file. Whenever you change that file, you will need to use the -c switch with Build to force it to create a new Makefile with your new information in it. You do this by adding the -c switch to Build’s command line:

% ./Build -c -f ../../builds/oursite.m4
% ./Build -cif using devtools/Site

For large compiles, such as sendmail, this process can be lengthy, but it is necessary, for without it your m4 build file changes will mysteriously appear to have no effect.

Use libresolv.a

If, when you compiled sendmail, the linker reported _res_ routines as missing, you might need to specify the resolver library with -lresolv:

APPENDDEF(`confLIBS', `-lresolv')

This shows one way to include that library with m4 builds. Another way might look like this:

APPENDDEF(`confLIBS', `/usr/local/lib/libresolv.a')

To ensure that sendmail achieves its optimum use of lookups, make sure your resolver library is derived from the latest BIND release: BIND 8.3.3.[34] You might also need to include -l44bsd on the LIBS= line if you are running BIND 4.9.

The tricky part is finding out which resolver library your system supports. With SunOS systems, for example, resolver support in the standard C library uses nis for name resolution. Although this setup might be good for most applications, it is inappropriate for sendmail. SunOS supplies a libresolv.a, but it is based on BIND 4.3 and so should probably be replaced with a newer version.

If your resolver library is not the correct one, you need to compile and install the newest version. You should do this even if it is used only by sendmail.

Badly Defined sys_errlist

Some systems define sys_errlist differently than sendmail does. On such systems, you might see a spurious warning about sys_errlist being redefined.

In general, you should never get this error. But if you are building sendmail on a system that is similar to, but not identical to, one already supported, you might see such a warning. See ERRLIST_PREDEFINED on page 112 for a description of how to use ERRLIST_PREDEFINED to fix the problem, should it occur.

Error at or Near Variable

Some older compilers don’t recognize the "void *" expression. With such compilers, you might see an error something like this:

"./sendmail.h", line 735: syntax error at or near variable name "void"

If you get an error like this, you should define ARBPTR_T (...T on page 148) like this:

APPENDDEF(`confENVDEF', `-DARBPTR_T=\"char *\"')

Undefined Symbol strtoul

If you are building sendmail using a compiler that claims to be ANSI-compliant, but is not really so, you might see an error like this:

ld: Undefined symbol
       strtoul

If you do, your compiler is mildly broken. Fortunately, sendmail offers an easy solution. Just edit your Build m4 file, and add a line such as the following:

APPENDDEF(`confENVDEF',`-DBROKEN_ANSI_LIBRARY=1')

Rebuild with the -c Build switch, and this problem will go away.

warning: & before array

On old Unix systems and those that run non-ANSI-compliant C-language compilers, the following error might appear when compiling sendmail:

"daemon.c", line 678: warning: & before array or function: ignored
"daemon.c", line 678: warning: illegal pointer combination

These warnings are harmless and can be ignored.

Other Considerations

As you watch the output while sendmail builds, you might notice commands being executed that you disagree with. Formatting of manuals, for example, might be a step you would rather skip. For each such problem, review the information in this and the next chapter. Correct your m4 build file and rerun Build, but this time add the -c switch. That switch causes Build to clear out the obj directory, then create a new Makefile with your new m4 build file settings:

# ./Build -c -f /path/to/your/m4/file

This can be an iterative process, so be patient.

Tuning sendmail to exactly fit your particular site’s needs can be a learning process. Be patient, as this and the next chapter contain a huge amount of information, and the way various macros interact can be confusing at first.

Install sendmail

There are two approaches to installing a new sendmail:

  • If you choose to run the new sendmail in place of the original, you first need to create and install a new configuration file. The m4(1) program is used to automate the process of configuration file creation. See Chapter 17 on page 584 for a full description of this process.

  • If you choose to keep the original and install the new sendmail in parallel (until you can test it), you can proceed with the installation and defer configuration files until later. Note that this choice presumes you customized the file locations.

After you have compiled sendmail (and if the configuration file is ready and tested), you can install it as your production version. If you are already running a sendmail and will be overwriting that binary, you will need to kill that version first (Daemon mode (-bd) on page 20).

Beginning with V8.12,[35] installation of sendmail became a bit more complex. You now have the choice of running sendmail as either a set-user-id root or a non-set-user-id root program. Our recommendation, beginning with V8.12, is to run sendmail as a non-set-user-id root. If you wish to install sendmail as a set-user-id root program, despite the potential security risks implied by such an approach, just issue this new special command:

# ./Build install-set-user-id

The preferred way to install sendmail, beginning with V8.12, is to first create three required system changes, and then to run ./Build install as usual:

  • Edit the /etc/passwd file (and possibly companion files such as /etc/shadow and /etc/master.passwd, or possibly network services such as Network Information Services [NIS]) to add the user smmsp. The name smmsp can be changed from its default with the confMSPQOWN build macro (confMSPQOWN on page 91). The specifics of adding a new user will vary based on the version of Unix you are running.

  • Edit /etc/group file (or possibly network services such as NIS) to add the new group smmsp. The name smmsp can be changed from its default with the confGBINGRP build macro (confGBIN... on page 76). The specifics of adding a new group will vary based on the version of Unix you are running.

  • Edit the /etc/rc.local file (or a different file depending on your version of Unix, such as /etc/init.d/sendmail or /etc/rc.conf) to change the way sendmail is started and stopped at boot time.

In a non-set-user-id root world, sendmail runs under two guises. In one guise, it is run by root to function as a listening daemon. This listening daemon is just like the listening daemon of earlier versions, except that, instead of running as root no matter who ran it, it now runs as root only if root runs it.

In its second guise, sendmail runs as an ordinary user to collect locally submitted messages. In this mode of operation, sendmail is set-group-id to a special group, so it runs in that group no matter who runs it. That group owns and has write permission to a separate queue into which locally submitted deferred messages are placed.

For this division of labor to work, the two guises need to use different configuration files. The configuration file used by the listening daemon is the traditional sendmail.cf file discussed throughout this book.[36] The configuration file used by the locally submitted message sendmail is called submit.cf.[37] Which configuration is used depends on how sendmail is run.

If sendmail is run with the -bm command-line switch (-bm on page 235), the -bs command-line switch (-bs on page 236), or the -t command-line switch (-t on page 248), it first tries to open and read submit.cf. If that file does not exist, sendmail falls back to reading its standard configuration file. The -bm command-line switch (sendmail’s default mode) causes sendmail to run as a mail sender, once in the foreground, gathering a list of recipients from the command line and reading the message from its standard input. The -bs command-line switch causes sendmail to run a single SMTP session in the foreground over its standard input and output, and then to exit. The -t command-line switch causes sendmail to gather its list of recipients from its standard input rather than from the command line.

In addition to determining the use of submit.cf based on sendmail’s mode of operation, sendmail can also be coerced into using or not using submit.cf based on a new command-line switch. The -A command-line switch takes one of two possible arguments. If it is followed by an m character, sendmail uses the sendmail.cf file. If the -A is followed by a c character, sendmail uses the submit.cf file:

/usr/sbin/sendmail -Am          ← use sendmail.cf
/usr/sbin/sendmail -Ac          ← use submit.cf

In the following sections, we first discuss the three system file modifications, then present a discussion of how to create and configure a submit.cf file.

Add smmsp to /etc/passwd

When sendmail is run as non-set-user-id root, it is run either as root when it is invoked by the root user, or as another user when it should not run as root. The sendmail distribution clearly cannot divine ahead of time what user you wish to use when not running sendmail as root. It could have chosen nobody, for example, but the user nobody does not exist under all versions of Unix.

You can choose your own username by using the confMSPQOWN build macro (confMSPQOWN on page 91) to place a line such as this into your build m4 file:

define(`confMSPQOWN', `nullmail')

If you change the username, you will also have to build and install your own submit.cf file, and include in the mc file, for that creation, a definition for the new users with the RunAsUser option (RunAsUser on page 1083), like this:

FEATURE(`msp')
define(`confRUN_AS_USER', `nullmail')

If you don’t change the name, sendmail will use the name smmsp, which stands for SendMail Message Submission Program.

Whether your keep the username chosen by the sendmail distribution, or choose a name of your own, you will need to add that name to your system’s passwd(5) services. Here we show how to do this with the traditional Unix passwd(5) file. Consider the lessons taught here, and apply them to your passwd(5) services in the manner most suitable to your Unix system:

nullmail:*:32764:32764:Null Mail:/no/such/directory:/bin/false

In this example of a line from a traditional Unix passwd(5) file, we have elected to create the user named nullmail. The line is divided into five fields by colons. The first field is the name of the new user. The second field is the user’s password. But because this user is not an actual person, we disable the password with an asterisk. On some systems you will need to put an x in this field, or the word NOPASSWORD. See your system documentation for what to use in this field to disable a password for this new user.

The third and fourth fields are the user and group ID for the user. Here, we chose high numbers that are unlikely to conflict with actual user numbers. Some versions of Unix restrict the size of the numbers you can use. See your system’s documentation. The fifth field is called the gecos field. It contains the full name of the users. We chose Null Mail, but you can choose any name you desire.

The last two fields are the home directory and shell for this user. The home directory should not exist, nor should it have the potential of ever existing. The shell should be a program that will never successfully run. We chose /bin/false because that program always exits with a nonzero (failure) value.

Add smmsp to /etc/group

When sendmail is run as non-set-user-id root, it is run either as root when it is invoked by the root user (in which case it can read all files), or as another user when it should not run as root. To enable the sendmail program to read and write its queue when it is not root, it needs to always run as a predefined group. It does this by having its set-group-id permission set, and by running under an appropriate group. The sendmail distribution clearly cannot divine ahead of time what group you wish to use when not running sendmail as set-group-id. It could have chosen nogroup, for example, but the user nogroup does not exist under all versions of Unix.

You can choose your own group by using the confGBINGRP build macro (confGBIN... on page 76) to place a line such as the following into your build m4 file. But don’t chose a group that is shared by any other user. For security reasons, the group you choose should be used only by sendmail:

define(`confGBINGRP', `nullgroup')

If you change the group, you will also have to build and install your own submit.cf file, and include in the mc file, for that creation, a definition for that new group with the RunAsUser option (The RunAsUser option (V8.8 and above) on page 176), like this:

FEATURE(`msp')
define(`confRUN_AS_USER', `:nullgroup')

Note that the same option sets both the user and the group. A combined declaration might look like this:

FEATURE(`msp')
define(`confRUN_AS_USER', `nullmail:nullgroup')

If you don’t change the group, sendmail will use the group smmsp.

Whether you keep the group name chosen by the sendmail distribution, or choose a name of your own, you will need to add that name to your system’s group(5) services. Here we show how to do this with the traditional Unix group(5) file. Consider the lessons taught here, and apply them to your group(5) services in the manner most suitable to your Unix system:

nullgroup:*:32764:

In this example of a line from a traditional Unix group(5) file, we have elected to create the group named nullgroup. The line is divided into four fields by colons. The first field is the name of the new group. The second field is the group’s password. Because this group is not used by actual people, we disable the password with an asterisk. On some systems you will put an x in this field, or the word NOPASSWORD. See your system documentation to learn what is best to use in this field to disable a password for this new group.

The third field contains the group number. That number should match the number used in the group field of the passwd(5) file. The last field contains the usernames of those that should also belong to this group. Generally, this will be an empty field.

Modify init Files

In a non-set-user-id root world, you run sendmail differently than the traditional manner to which you have become accustomed. There are two differences that you should attend to before installing the new non-set-user-id root setup. First, you need to decide how to drain the local message submission queue. Second, you need to decide on a name to differentiate the two roles with the syslog(8) facility.

For local mail submission, sendmail will use a separate queue, one that is group read/write by the group discussed in the previous section. The sendmail program, in local message submission mode, sends a message and then exits. As a consequence, there is nothing running that can drain that separate queue of any messages that might be deferred there. The best way to drain it is with a queue processing daemon, such as this:

/usr/sbin/sendmail -Ac -q30m

Here, the -Ac command-line switch tells sendmail to use the configuration file named submit.cf. This is the special message submission configuration file that knows about the second queue. The -q30m command-line switch causes sendmail to wake up once each 30 minutes and process any deferred messages it finds in the second queue.[38]

To differentiate one sendmail from another in the logs created by the syslog(8) facility, you can use the -L command-line switch (-L on page 243). One suggestion looks like this:

/usr/sbin/sendmail -L mta-daemon -bd -q30m
/usr/sbin/sendmail -L msp-queue -Ac -q30m

The first line is the invocation of sendmail that is most common (with the -bd -q30m). The second line has been added to drain the second (mail submission) queue. The first will contain the identifier mta-daemon in its syslog(8) logfiles. The second will contain the identifier msp-queue. These identifiers are only suggestions, and you might prefer something more suitable to your site’s needs.

The sendmail program is usually started from a script in the etc directory. On System-V-based versions of Unix, that file is usually found in the /etc/init.d directory. On other versions of Unix, that file could live directly in the etc directory, and might be called rc or rc.local. Whichever file contains the commands to start sendmail on your system, look at it and determine how sendmail is currently started and stopped. You might, for example, find lines such as this, from a FreeBSD 4.0 sendmail startup file called rc:

case ${sendmail_enable} in
[Yy][Ee][Ss])
        if [ -r /etc/mail/sendmail.cf ]; then
                echo -n ` sendmail';    /usr/sbin/sendmail ${sendmail_flags}
        fi
        ;;
esac

To modify this setup for use in a non-set-user-id root scheme, you would need to add the following line to your /etc/rc.conf file:

sendmail_flags="${sendmail_flags} -L mta-daemon"

Then create the file /etc/rc.local (if it does not already exist), and add the following lines to it:

case ${sendmail_enable} in
[Yy][Ee][Ss])
        if [ -r /etc/mail/sendmail.cf ]; then
                echo -n ` msp-queue';     /usr/sbin/sendmail -L msp-queue -q30m
        fi
        ;;
esac

Take the time, now, to investigate how sendmail is started and stopped on your system. The new non-set-user-id root scheme will doubtless require special modifications on your part. Beginning with Solaris 7, for example, the pkill(8) command, as it is set up in /etc/init.d/sendmail, will not stop a sendmail that is running other than as root.

The submit.cf File

The submit.cf file is built for you automatically when you install sendmail.[39] When you run make install, the following is one of the commands executed:

cd ../../cf/cf && make install-submit-cf

This command will create and install a default /etc/mail/submit.cf file if that file does not already exist. For most sites, this default will be suitable for your use as is. If you customize at all, however, you will need to create your own submit.cf file. If, for example, you changed the user and group names for the non-set-user-id root version of sendmail with the following in your build m4 file:

define(`confMSPQOWN', `nullmail')
define(`confGBINGRP', `nullgroup')

you will need to create a custom submit.cf file. You create a custom submit.cf file just like you create a sendmail.cf file (Configure with m4 on page 587). You begin by creating a file called submit.mc. You can use the file cf/cf/submit.mc as a template for your own, or you can edit that file directly. If you edit that file directly, you will need to copy your changes to the same directory each time you upgrade sendmail to a new version.

Note that the name submit.cf is hardcoded and cannot be changed. When sendmail runs, unless you have built it to do otherwise, it will look for submit.cf in the same directory that it looks for its standard configuration file. If you change the location of the standard configuration file with the _PATH_SENDMAILCF build-time macro (_PATH... on page 131), you will also want to change the directory in which the submit.cf file is located. That directory is defined with the _DIR_SENDMAILCF build-time macro.[40] For example, your build m4 file might look, in part, like this:

APPENDDEF(`confENVDEF', `-D_PATH_SENDMAILCF=\"/opt/sendmail/sendmail.cf\"')
APPENDDEF(`confENVDEF', `-D_DIR_SENDMAILCF=\"/opt/sendmail/\"')

Here, the first line changes the location of the sendmail.cf file. The second line is necessary so that sendmail will look for submit.cf in that same directory. Without this second line, sendmail would look for sendmail.cf in /opt/sendmail, but would look for submit.cf in the default location, /etc/mail.

Note that a Build install will always try to place the submit.cf file into a directory that begins with /etc/mail. But you can prefix this directory with another directory name, as shown here:

# ./Build -E DESTDIR=/opt/sendmail install

This will cause the submit.cf file to be installed in the /opt/sendmail/etc/mail directory. If you have changed the location of your configuration files, as shown earlier, you will have to manually move the submit.cf file from its default installed location to your chosen location.[41]

Table 2-5 shows how the Build process parallels the creation of the submit.cf file in certain limited ways.

Table 2-5. Considerations for the submit.cf file

m4 macro

m4 default

mc macro

Description

[a]

confMSPQOWN

smmsp

confRUN_AS_USER

User ID

confGBINGRP

smmsp

confRUN_AS_USER

Group ID

confMSP_QUEUE_DIR

/var/spool/clientmqueue

MSP_QUEUE_DIR

MSP queue

_DIR_SENDMAILCF

/etc/mail[a]

None

cf file dir

[a] a Prior to V8.10, sendmail placed its configuration and other files in /etc.

Note again that _DIR_SENDMAILCF does not affect where Build install places the submit.cf file.

Finally, note that by renaming or relocating the queue directory with the confMSP_QUEUE_DIRBuild macro (confMSP_QUEUE_DIR on page 91), the MSP_QUEUE_DIR mc macro must also be updated so that a correct submit.cf file will be created.

Error /etc/mail Not a Directory

Beginning with V8.10 sendmail, the configuration file and other files are located in /etc/mail. When installing, the following error can occur if /etc/mail is not a directory:

install -c -o bin -g bin -m 444 helpfile /etc/mail/helpfile
install: /etc/mail/helpfile: Not a directory
*** Error code 1

Here, /etc/mail is not a directory, but is instead a file. If the file /etc/mail is serving no current purpose, consider removing or renaming it and rerunning Build. If that file is still important, take the time now to discover why and change its name. All modern versions of sendmail are grounded in the /etc/mail directory, so taking time now to free that name will be well spent.

The MAIL_SETTINGS_DIR mc Macro

The name of the default directory, /etc/mail, is stored in the MAIL_SETTINGS_DIR mc configuration macro. You can redefine this macro to relocate that default to a new directory, but if you do, be certain that the declaration ends in a slash character:

define(`MAIL_SETTINGS_DIR', `/opt/sendmail/etc/')
                                              ↑
                                        must end in a slash

Note that the MAIL_SETTINGS_DIR mc configuration macro must specify a full pathname, one that starts with a slash. If it does not specify a full pathname, unexpected problems might arise when you run sendmail.

When upgrading from the vendor’s version of sendmail to the open source version of sendmail, vendor assumptions about program locations might not agree with the new sendmail locations. One way to check for a mismatch is to look at the version of sendmail under each of its names. Consider, for example, a check to see whether sendmail and the newaliases program are the same:

% newaliases -d0.1 < /dev/null | head −1
Version 8.9.2
% /usr/lib/sendmail -d0.1 < /dev/null | head −1
Version 8.12.7

Here we find that newaliases is not a symbolic link to sendmail as we expected. Finding the cause of this mismatch can take some investigation. Under BSDI 3.x, for example, the /usr/sbin/newaliases program is a hard link, not a symbolic link, so replacing sendmail will not affect it.

Pitfalls

  • Before replacing your current sendmail with a new version, be sure that the queue is empty. The new version might not be able to properly process old (or different) style queued files.[42] After running the new sendmail for the first time, look in the queue directory for filenames that start with an uppercase Q, which can indicate a problem. See Bogus qf Files on page 419 for a description of why these files appear and what to do about them.

  • If you change the location of the queue to a different disk, be sure that disk is mounted (in /etc/rc) before the sendmail daemon is started. If sendmail starts first, there is a risk that messages will be queued in the mount point before the disk is mounted. This will result in mysteriously vanishing mail.

  • Always save the old sendmail and configuration file. The new version might fail when you first try to run it. If the failure is difficult to diagnose, you might need to run the old version while you fix the new version. But beware that the old version will probably not be able to read the queue files created by the new version.

  • Some operating systems allow disks to be mounted such that set-user-id permissions are disallowed. If you relocate sendmail, avoid locating it on such a disk.

  • Don’t be mistaken in the belief that nis will correctly give you MX (Mail eXchanger) for hosts. If, after compiling and installing sendmail, you find that you cannot send mail to hosts using MX records, you should recompile with NAMED_BIND defined (NAMED_BIND on page 124). Also note that a misconfigured service-switch file can also prevent proper MX lookups (ServiceSwitchFile on page 1088).

Build m4 Macro Reference

In this section, we list all the current Build macros available for use in your m4 build file. They are listed in alphabetical order and summarized in Table 2-6 in confDEPEND_TYPE .

Some of these build macros set values for #define macros. For a description of each of those #define macros see Chapter 3 on page 103.

APPENDDEF( )

Append to an existing define Build directive

The APPENDDEF( ) m4 directive allows you to append new information to information that was previously defined. To illustrate, consider that the locations of your #include files are sometimes preset in the appropriate devtools/OS directory. For OS/UXPDS.V10, for example, the default is:

-I/usr/include -I/usr/ucbinclude

You can use this APPENDDEF( ) directive to add another directory to this list, without erasing what is already there:

APPENDDEF(`confINCDIRS', `-I/usr/local/include/db')

This causes the new directory to be appended to the declaration in the previous example:

-I/usr/include -I/usr/ucbinclude -I/usr/local/include/db

Even when you are not sure whether a macro has been given a value by default, you can safely use this APPENDDEF( ) directive because no harm is caused by appending to an empty definition. See also PREPENDDEF( ) in PREPENDDEF( ) on page 102.

confBEFORE

Establish files before compiling Build macro

The confBEFORE macro is used to specify the presence of a special header file before compiling. The confBEFORE macro causes an appropriate BEFORE= directive to appear in your Makefile. It is very unlikely that you will ever have to change this from the value that is predefined for you. But if you do, you can do so like this illustration from SunOS 4.0:

define(`confBEFORE', `stdlib.h stddef.h limits.h')
PUSHDIVERT(3)
stddef.h stdlib.h limits.h:
        cp /dev/null $@
POPDIVERT

First, note that the declaration of confBEFORE requires a corresponding section of Makefile code to be inserted between diversions (PUSHDIVERT and POPDIVERT). The first line in this example says that the three files stdlib.h, stddef.h, and limits.h must exist in the obj... directory before sendmail can be compiled. It causes those three header files to be listed with the BEFORE= directive in the resulting Makefile:

BEFORE= stdlib.h stddef.h limits.h
...
sendmail: ${BEFORE} ${OBJS}

The diversion level 3 (in PUSHDIVERT) causes the two lines that follow to be inserted into the Makefile at the appropriate point. The diversion ends with POPDIVERT.

To illustrate further, suppose you want to include your own C-language source and header files with the Build of sendmail. One way to do this might be to add the following lines to your m4 build file:

APPENDDEF(`conf_sendmail_ENVDEF', `-DMYCODE')
APPENDDEF(`confBEFORE', `mycode.h')
APPENDDEF(`confSMOBJADD', `mycode.o')
PUSHDIVERT(3)
mycode.h mycode.c:
       ln -s /usr/local/src/mycode/$@
POPDIVERT

The first line adds -DMYCODE to the ENVDEF= line in Makefile (confENVDEF and conf_prog_ENVDEF on page 75). Here, we presume that C-language hooks have been added to the sendmail source, and that they are enabled/disabled by wrapping them in preprocessor conditionals.[43] For example:

# ifdef MYCODE
                if (mycode(e->e_eid) < 0)
                       return FALSE;
# endif

The second line in your m4 file appends mycode.h to this confBEFORE macro. The third line causes the OBJADD= directive in Makefile to be given the value mycode.o (confOBJADD on page 93). This automatically adds that object filename to the list of all object files in Makefile:

... util.o version.o ${OBJADD}

Finally, the diversion adds Makefile commands to ensure that the symbolic links to the required C-language source files exist before sendmail is compiled.

confBLDVARIANT

Controls variations on objects Build macro

This confBLDVARIANT Build macro is used to convey to the make program a notion of how the compile should run. The possibilities are:

DEBUG

Sets the confOPTIMIZE Build macro to a value of -g for FreeBSD or -g -Wall for Linux

OPTIMIZED

Sets the confOPTIMIZE Build macro to a value of -O for FreeBSD or -O2 for Linux

PURIFY

Sets the confOPTIMIZE Build macro to a value of -g for FreeBSD and Linux

You use the confBLDVARIANT Build macro like this:

define(`confBLDVARIANT', `DEBUG')
define(`confBLDVARIANT', `OPTIMIZED')
define(`confBLDVARIANT', `PURIFY')

The -v command-line switch (-v on page 353) for the Build program uses command-line arguments of debug, optimized, and purify to automatically set this confBLDVARIANT macro.

Note that the arguments used for confBLDVARIANT are all uppercase, whereas those used for -v are all lowercase.

Variants are available only for FreeBSD and Linux as of V8.12.2 sendmail. If you are on another OS, this macro will silently be ignored. If you attempt to use PURIFY, you will see the following Build-time error:

Sorry, the purify build variant has not been plumbed yet. (Bummer.)

Read the RELEASE_NOTES file supplied with the sendmail source to see whether more recent versions support purify and other operating systems.

confBUILDBIN

Location of devtools/bin Build macro

The confBUILDBIN macro is used to define the location of the devtools/bin directory. Normally, this macro will never have to be defined because the default value is correct, but there might be a rare circumstance when you will need to redefine it. If, for example, you need to move the devtools/bin directory to a different path, or rename it, you can do so like this:

define(`confBUILDBIN', `../../OLD_devtools/bin')

Note that the value given to confBUILDBIN must be either an absolute path or a path relative to the obj directory (sendmail is built inside the obj directory).

The confBUILDBIN macro sets the BUILDBIN= line in Makefile. Depending on your operating system, that line might or might not be used. For Solaris 2.5, for example, it is used like this:

INSTALL=${BUILDBIN}/install.sh

One use for confBUILDBIN can occur when you are actively modifying the sendmail code, and it becomes appropriate to maintain the source completely separate from the normal distribution tree.

confCC

Compiler used to build sendmail Build macro

The confCC macro is used to specify which C-language compiler to use when building sendmail. The default is probably appropriate for your system, but there might be times when a different compiler is preferred. For example, imagine that you wanted to use Sun’s unbundled compiler instead of gcc(1) under Solaris 2.5:

define(`confCC', `/usr/opt/SUNWspro/bin/cc')

The confCC macro might also be used to compile for testing with purify(1):

define(`confCC', `/usr/local/bin/purify cc')

Or you might need to use a specific version of gcc:

define(`confCC', `gcc -V2.7.2.1')

When compiling under Solaris with Sun’s unbundled compiler, you will need to declare the following two lines:

define(`confCC', `/opt/SUNWspro/bin/cc')
define(`confDEPEND_TYPE', `Solaris')

Here, a confDEPEND_TYPE of Solaris causes a Makefile to be constructed with correct dependencies for Sun’s unbundled compiler (confDEPEND_TYPE on page 73).

The confCC macro provides the value used with the CC= Makefile directive. This value is used to compile .o files from .c files, and to ld(1) the final sendmail executable.

Linker to use when confCC is inappropriate (V8.14 and later) Build macro

Some build systems do not use the compiler to link executables. For such systems, it is now possible to specify a linker to use in place of the compiler:

define(`confCCLINK', `/builds/osx/compat/bin/ld')

Because sendmail’s build is tuned to work best with the compiler, redefining the linker may not be as straightforward as you might expect. Be prepared to experiment with wrapper scripts, for example, to tweak command-line switches to get your linker to work.

confCCOPTS

Command-line switches to pass to the compiler Build macro

When compiling sendmail or its companion programs, you might need to add special command-line flags to the compiler’s invocation. One example might be the need to add a -nostdinc switch for gcc. The confCCOPTS macro allows you to do this. The following instructs the gcc compiler to allow traditional K&R instructions:

define(`confCCOPTS', `-traditional')

confCCOPTS_SO

Command-line switches for shared-library objects Build macro

Use of this macro is not supported in the open source version of sendmail.

confCOPY

The copy command to use Build macro

The process of building sendmail includes initializing the contents of some associated files. One example is the statistics file. That file should begin as an empty file. The build process creates it with a command line such as this:

cp /dev/null statistics

For safety’s sake, especially if you changed the name of the statistics file with the confSTFILE macro (confSTFILE and confSTMODE on page 99), you might change the copy command’s invocation to:

define(`confCOPY', `cp -i')

The -i causes cp(1) to prompt for your OK if the target file already exists.

confDEPEND_TYPE

How to build Makefile dependencies Build macro

The confDEPEND_TYPE macro defines the method that should be included in your Makefile for use in creating make(1) dependencies. The methods supported are located in the devtools/M4/depend directory. We show them in Table 2-6.

Table 2-6. Build m4 directives

Method

File

How invoked

AIX

devtools/M4/depend/AIX.m4

${CC} -M -E ${COPTS} $$i

BSD

devtools/M4/depend/BSD.m4

mkdep -a -f Makefile ${COPTS} *.c

CC-M

devtools/M4/depend/CC-M.m4

${CC} -M ${COPTS} *.c >> Makefile

Generic

devtools/M4/depend/generic.m4

Nothing

NCR

devtools/M4/depend/NCR.m4

${CC} -w0 -Hmake ${COPTS} *.c >> Makefile

Solaris

devtools/M4/depend/Solaris.m4

${CC} -xM ${COPTS} *.c >> Makefile

X11

devtools/M4/depend/X11.m4

makedepend -- ${COPTS} -- *.c

Note that the correct Solaris method is usually chosen for you in an appropriate devtools/OS file. But in the rare case that the method is wrong or broken, you can use this confDEPEND_TYPE to select another method. For example, consider this broken implementation of an mkdep script:

mkdep -a -f Makefile -I. -DNEWDB *.c
cc: Warning: Option -f passed to ld
cc: Warning: File with unknown suffix (Makefile) passed to ld

In this example, we know we are running X11, and so we chose to replace the defective mkdep with the makedepend(1) program:

define(`confDEPEND_TYPE', `X11')

The new method is specified as the filename (with the .m4 suffix removed) in the devtools/M4/depend directory. Rerunning the Build with -c and this new definition will produce error-free output:

Making dependencies in obj.SunOS.4.1.3.sun4
makedepend -- -I. -I/usr/local/include/db -DNEWDB -DNEWDB -DMATCHGECOS=0 -- *.c
Making in obj.SunOS.4.1.3.sun4

confDEPLIBS

Shared object dependencies Build macro

Ordinarily, sendmail and its companion programs, such as vacation, are linked statically. You might prefer to link some of your programs dynamically so that you can take advantage of shared libraries. Unfortunately, the macros needed to perform such linking are not available for the open source version of sendmail.

confDONT_INSTALL_CATMAN

No preformatted manuals Build macro

Ordinarily, Build installs the unformatted manual pages in a place such as /usr/share/man/man8, which is in the man* directories. Unless it is told not to, it will also install the formatted pages in a place such as /usr/share/man/cat8, which is in the cat* directories. If your site stores only unformatted pages (perhaps to save disk space), you can prevent the installation of the formatted pages by using an m4 declaration such as this:

define(`confDONT_INSTALL_CATMAN')

confEBINDIR

Bin directory for mail.local and smrsh Build macro

The confEBINDIR macro tells the Build program where to install the smrsh(1) (Configure to Use smrsh on page 380) and mail.local(1) (FEATURE(local_lmtp) on page 625) programs when they are built. Defining it sets the directory where these programs will be installed, and where sendmail will look when executing them. For example:

define(`confEBINDIR', `/opt/mail/bin')

There is not a single default for this setting. Instead, it is usually predefined in one of the osytpe files (OSTYPE( ) m4 macro on page 590) specific to your operating system (normally /usr/libexec or /usr/sbin).

The smrsh(1) program is located in the smrsh subdirectory of the source distribution. It can be built like this:

% cd smrsh
% ./Build -f ../../builds/oursite.m4

The mail.local program is located in the mail.local subdirectory of the source distribution. It can be built like this:

% cd mail.local
% ./Build -f ../../builds/oursite.m4

Be sure that the setting of confEBINDIR in your m4 build file matches the setting in your configuration m4 file. If you fail to take this precaution, those programs will be installed in a directory different from the one in which sendmail expects to find them.

confENVDEF and conf_prog_ENVDEF

Pass -D switches during compilation Build macro

The conf_prog_ENVDEF macros are used to assign values to the ENVDEF= Makefile directive in the Makefiles for the various programs in the source tree. The ENVDEF= directive is primarily used to specify code that should be specially included or excluded when compiling. The following example shows support for identd(8) being excluded from the compiled binary of sendmail:[44]

APPENDDEF(`conf_sendmail_ENVDEF', `-DIDENTPROTO=0')

Note that conf_prog_ENVDEF is often given values in the devtools/OS file for your architecture. To avoid clobbering those values, use APPENDDEF to define conf_prog_ENVDEF.

To use the conf_prog_ENVDEF macro, simply replace the "prog" with the name of any of the programs or library directories in the sendmail source tree. For example, conf_vacation_ENVDEF is used with the vacation program, and conf_mail_local_ENVDEF[45] is used with the mail.local program.

When a single macro is needed to affect all programs, you can use the confENVDEF macro:

APPENDDEF(`confENVDEF', `-DNISPLUS=1')

Here we enable use of Sun’s NIS+ services (NISPLUS on page 129) for any program that will look up password, group, or similar information.

In Table 3-7 on page 121, the third column indicates whether it is appropriate to redefine a particular macro in your Makefile. Where appropriate, most will be defined with a confENVDEF macro.

confFORCE_RMAIL

Install the rmail program no matter what Build macro

The rmail(8) program is part of the UUCP suite of software. It handles mail that comes in via UUCP, modifies some address information, and hands the result to sendmail.

The rmail program is supplied with the sendmail source distribution because most implementations of that program are deficient in many ways. The source for rmail is from BSD 4.4 Unix and is probably not suitable for other environments. If you actually run UUCP, and if you need a more robust rmail, you are encouraged to port this program to your system.

Because using or installing this version of rmail is not recommended, the default action of Build is to print the following when invoked:

% cd rmail
% ./Build install
NOTE: This version of rmail is not suited for some operating
      systems.  You can force the install using
      'make force-install'.

If you want to change this default action, you can do so by defining this confFORCE_RMAIL macro:

define(`confFORCE_RMAIL', `TRUE')

With this definition in your m4 file, the default action of Build changes to:

% cd rmail
% ./Build install
install -c -o bin -g bin -m 555 rmail /usr/ucb

which does the install. The owner, group, and mode are set with confUBINOWN (confUBINOWN on page 101), confUBINGRP (confUBINGRP on page 101), and confUBINMODE (confUBINMODE on page 101), respectively.

confGBIN...

The set-group-id settings Build macro

The non-set-user-id root version of sendmail (Install sendmail on page 60) uses a set-group-id means of identity instead of the normal set-user-id root means. That is, it assumes the group identity specified, no matter who runs it.

Three macros tune the group identity and permission for this non-set-user-id root version. They are:

confGBINGRP

This macro sets the group that the non-set-user-id root version of sendmail should belong to. The group defaults to smmsp. If, as illustrated in Add smmsp to /etc/group on page 63, you wish to use a different group, you can do so like this:

define(`confGBINGRP', `nullmail')   ← use a group name
define(`confGBINGRP', `5343')       ← use a group number

If you use a positive number that is not too large, it will be accepted no matter what. If you use a name that is not defined in the /etc/group file, you might see the following error and the build will fail:

chgrp: nullmail: unknown group
confGBINMODE

This macro defines the execution mode that the non-set-user-id root version of sendmail will have. The default is mode 2555, which is set-group-id (the 2), and readable and executable by the owner, group, and world (the 555). One reason to change this default might be to prevent ordinary users from copying the binary. You would make such a change like this:

define(`confGBINMODE', `2551')      ← correct
define(`confGBINMODE', `551')       ← wrong, don't omit the leading 2

If you mistakenly omit the leading 2, the created non-set-user-id root version of sendmail will lose its ability to execute a set-group-id. If you use an illegal permission value, such as 9555, you will see the following error and the build will fail:

chmod: invalid mode
confGBINOWN

This macro defines who will own the non-set-user-id root version of sendmail. The owner has no effect on who will own the program when it is run. It will be owned by whoever runs it. You can set its ownership to a different owner, if you prefer, with an m4 Build macro such as this:

define(`confGBINOWN', `nomail')     ← use a username
define(`confGBINOWN', `7629')       ← use a user number

If you use a positive number that is not too large, it will be accepted no matter what. If you use a name that is not defined in the /etc/passwd file (or in a related file such as /etc/shadow), you might see the following error and the build will fail:

chown: unknown user id: nomail

confHFDIR

Where to install the sendmail help file Build macro

The confHFDIR macro defines the location (directory) where the sendmail program’s help file should be installed. The help file contains help for SMTP and -bt rule-testing commands. It is very unlikely that you will ever have to change this from the value that is predefined for you (usually /etc/mail). But if you do, you can do so like this:

define(`confHFDIR', `/admin/mail/etc')

If you redefine this directory, you must also redefine the HELP_FILE configuration macro (HelpFile on page 1035) so that the correct path appears in your sendmail.cf file’s HelpFile option.

confHFFILE

The name of the sendmail help file Build macro

Prior to V8.10 sendmail, the name of the SMTP and -bt rule-testing help file was sendmail.hf. Beginning with V8.10 sendmail, the default name is helpfile. To change back to the old name, perhaps for sentimental reasons, you can do the following:

define(`confHFFILE', `sendmail.hf')

If you redefine this name, you must also redefine the HELP_FILE configuration macro (HelpFile on page 1035) so that the correct name appears in your sendmail.cf file’s HelpFile option.

confINCDIRS

Compiler -I switches Build macro

The confINCDIRS macro defines the directories searched (using the compiler’s -I switch) for #include files. In general, this will be empty unless you are using libraries that are not normally used. For example, you might have installed the db(3) library in /usr/local/lib and its corresponding include files in /usr/local/include/db. In this case, you would define:

APPENDDEF(`confINCDIRS', `-I/usr/local/include/db')
APPENDDEF(`confLIBDIRS', `-L/usr/local/lib')

Here, we use the APPENDDEF directive to prevent (possibly) prior values from being overwritten. The -I will be passed to the C compiler. The -L will be passed to the loader.

Note that the -I must appear as part of the value. If you omit that switch, Build will not correct the mistake and your build of sendmail will fail.

confINC...

Installed #include file settings Build macro

The libmilter library installs two #include files in /usr/include as a part of its build. Those two files are mfapi.h and mfdef.h. Other programs might also install #include files in future versions.

The location of the #include directory, and the ownership and permission of those #include files, can be changed with the following Build macros:

confINCLUDEDIR

The confINCLUDEDIR macro determines where the #include files will be installed. For most sites, the correct directory will be defined in your devtools/OS file. But if you decide to put those #include files in a different directory, you can do so by defining this macro:

define(`confINCLUDEDIR', `/usr/share/mail/include')
confINCGRP

This macro sets the group that will own the #include files. The group defaults to bin. If you wish to use a different group you can do so like this:

define(`confINCGRP', `mbin')          ← use a group name
define(`confINCGRP', `343')           ← use a group number

If you use a positive number that is not too large, it will be accepted no matter what. If you use a name that is not defined in the /etc/group file, you might see the following error and the build will fail:

chgrp: mbin: unknown group
confINCMODE

This macro defines the permissions the installed #include files will have. The default is mode 0444, which is readable by the owner, group, and world. One reason to change this default might be to prohibit ordinary users from reading these files. You would make such a change like this:

define(`confMBINMODE', `0440')          ← remove world read permission

If you use an illegal permission value, such as 991, you will see the following error and the build will fail:

chmod: invalid mode
confINCOWN

This macro defines who will own the #include files. The default is root. You can set the ownership to a different owner if you prefer, with an m4 Build macro such as this:

define(`confINCOWN', `mbin')          ← use a username
define(`confINCOWN', `9')             ← use a user number

If you use a positive number that is not too large, it will be accepted no matter what. If you use a name that is not defined in the /etc/passwd file (or in a related file such as /etc/master.passwd), you might see the following error and the build will fail:

chown: unknown user id: mbin

confINSTALL

Program to install programs and files Build macro

The confINSTALL macro defines the program that will be used by make(1) to install sendmail. As distributed, the devtools/OS file for your machine’s architecture predefines this value for you. You should not need to redefine it unless you have customized your system in a way that makes that prior definition inappropriate:

define(`confINSTALL', `${BUILDBIN}/install.sh')

Here, we create a definition that tells make(1) to use devtools/bin/install.sh to install sendmail. The expression ${BUILDBIN} is a Makefile macro that defaults to the devtools/bin directory in the source distribution (see confBUILDBIN, confBUILDBIN on page 72, for a way to override that default).

Note that this macro also defines how manuals will be installed. It does not, however, control whether to install the manual pages (see the confNO_MAN_INSTALL macro, confNO_MAN_INSTALL on page 93). Nor does it define how to install symbolic links (see confLN, confLN on page 83).

confINSTALL_RAWMAN

Install unformatted manuals Build macro

Ordinarily, the manual pages are formatted when sendmail, or one of the companion programs, is built. These preformatted manuals are the ones installed in the cat manual directories when the program is installed. This confINSTALL_RAWMAN macro causes the unformatted (raw) manual pages to also be installed, but in the man manual directories. For example, with confINSTALL_RAWMAN defined:

% ./Build install
Configuration: pfx=, os=SunOS, rel=4.1.4, rbase=4, rroot=4.1, arch=sun4, sfx=
Making in ../obj.SunOS.4.1.4.sun4/sendmail
...
install -c -o bin -g bin -m 444 sendmail.0 /usr/man/cat8/sendmail.8
install -c -o bin -g bin -m 444 sendmail.8 /usr/man/man8/sendmail.8
... ← etc.

But with the confINSTALL_RAWMAN not defined:

% ./Build install
Configuration: pfx=, os=SunOS, rel=4.1.4, rbase=4, rroot=4.1, arch=sun4, sfx=
Making in ../obj.SunOS.4.1.4.sun4/sendmail
...
install -c -o bin -g bin -m 444 sendmail.0 /usr/man/cat8/sendmail.8
... ← etc.

confLD

The linker to use Build macro

Use of this macro is not supported in the open source version of sendmail.

confLDOPTS

Linker options Build macro

The confLDOPTS macro defines a list of operating-system-specific linker options. Those options are listed with the LDOPTS= directive in Makefile. As distributed, the devtools/OS file, for your machine’s architecture, predefines a list for you. For example, on SunOS machines the following is predefined:

define(`confLDOPTS', `-Bstatic')

This tells the linker to exclude dynamic library support for better security. If you wish to add linker options, use the APPENDDEF( ) directive to add them to the list (because other options probably already exist):

APPENDDEF(`confLDOPTS', `-s')

The linker option -s causes the executable file to be stripped of symbols, thus producing a somewhat smaller on-disk image. The example here shows one way to avoid having to remember to run install-strip with Build each time you install (confSTRIP on page 100).

confLDOPTS_SO

Linker options for creating a shared library Build macro

Use of this macro is not supported in the open source version of sendmail as of V8.12. There is no guarantee that it will become available in a future release.

confLIB...

Location and modes for installed library files Build macro

Beginning with V8.12, one library, the libmilter library, is now installed centrally for your use in designing you own filter programs. The library file, libmilter.a, is installed by default in the /usr/lib directory. Two corresponding #include files, mfapi.h and mfdef.h, are installed by default in the /usr/include/libmilter directory. No Unix manual pages are installed. Instead, you must read HTML files located under the sendmail source tree, in libmilter/docs, to learn how to use this library.

A number of build-time macros can be used to modify the ownership, location, and modes of the installed library (installation of the #include files is described in confINC... on page 78):

confLIBDIR

The confLIBDIR macro determines where the created library file will be installed. For most sites, the correct directory will be defined in your devtools/OS file (usually /usr/lib). But if you decide to put that library in a different directory, you can do so by defining this macro:

define(`confLIBDIR', `/usr/local/lib')
confLIBGRP

This macro sets the group that will own the installed library. The group defaults to bin. If you wish to use a different group you can do so like this:

define(`confLIBGRP', `mbin')    ← use a group name
define(`confLIBGRP', `343')     ← use a group number

If you use a positive number that is not too large, it will be accepted no matter what. If you use a name that is not defined in the /etc/group file, you might see the following error and the build will fail:

chgrp: mbin: unknown group
confLIBMODE

This macro defines the permissions that the installed library will be assigned. The default is mode 0444, which is readable by the owner, group, and world. One reason to change this default might be to prohibit ordinary users from reading these files. You would make such a change like this:

define(`confMBINMODE', `0440')  ← remove world read permission

If you use an illegal permission value, such as 991, you will see the following error and the build will fail:

chmod: invalid mode
confLIBOWN

This macro defines who will own the library. The default owner is root. You can set its ownership to a different owner if you prefer, with an m4 Build macro such as this:

define(`confLIBOWN', `mbin')   ← use a username
define(`confLIBOWN', `9')      ← use a user number

If you use a positive number that is not too large, it will be accepted no matter what. If you use a name that is not defined in the /etc/passwd file (or in a related file such as /etc/master.passwd), you might see the following error and the build will fail:

chown: unknown user id: mbin

confLIBDIRS

Linker -L switches Build macro

The confLIBDIRS macro defines the directories that are searched for library files (using the linker’s -L switch). The libraries in these directories are searched before the standard system libraries. Consider the desire to have libraries in the path /usr/local/lib used by the linker in preference to those in the standard library path:

APPENDDEF(`confLIBDIRS', `-L/usr/local/lib')

For example, multiple libraries can be searched by listing them in a single definition:

APPENDDEF(`confLIBDIRS', `-L/usr/local/lib -L/usr/tools/lib')

Note that the values defined for this macro must be prefixed by a literal -L. This confLIBDIRS macro is often used in conjunction with the confINCDIRS macro (confINCDIRS on page 78).

confLIBS and conf_prog_LIBS

Linker -l switches by program Build macro

The confLIBS and conf_prog_LIBS macros define a list of additional libraries to link against by name (using the loader’s -l switch). All devtools/OS files define defaults for this macro, so be sure to APPENDDEF( ) to avoid overwriting your defaults:

APPENDDEF(`confLIBS', `-ldb')
APPENDDEF(`conf_sendmail_LIBS', `-lwrap')

It is unlikely that you will have to add or change libraries in this list. To discover any you might need, run Build to completion and observe which routines the linker reports as missing.

The _prog_ part of the macro name is optional. If present, it should be the name of the specific program for which the build is being run. In the preceding example, -lwrap will be included in only the sendmail program’s build, but not in any other program’s build (as, for example, makemap). By excluding the _prog_ part of the macro name you create a declaration that affects all programs.

Note that for the mail.local program the _prog_ part can be either mail.local or mail_local with no difference in effect.

confLIBSEARCH

Automatic library search Build macro

The Build script automatically searches for critical (to sendmail) libraries and, if it finds any, automatically enables specific compile-time options. The list of libraries searched is in the internal confLIBSEARCH macro, which defaults to the following list:

db bind resolv 44bsd

The logic is that if a libdb.a or a libdb.so library is found in any of the directories listed with the confLIBSEARCHPATH macro (confLIBSEARCHPATH on page 83), -DNEWDB is automatically[46] defined for confENVDEF (confENVDEF and conf_prog_ENVDEF on page 75).

Then the library that is found first (libbind.a, libbind.so, libresolv.a, or libresolv.so) is added to the list of libraries in the confLIBS macro (confLIBS and conf_prog_LIBS on page 82). If lib44bsd is found, and if libresolv was the first found, 44bsd is also added to the confLIBS macro.

In the rare instance that this automatic search misconfigures for your site or particular build, you can carefully[47] redefine confLIBSEARCH. For example, suppose db has been installed at your site, but it is broken and you don’t have the time to fix it. You might do this:

dnl ********** Note, removed db until we fix it, bob **********
define('confLIBSEARCH', 'bind resolv 44bsd')

Note that you must use the dnl (delete to newline) directive to form a comment in m4(1).

confLIBSEARCHPATH

Automatic library search Build macro

The directories searched by the confLIBSEARCH macro (as noted earlier) are defined by this confLIBSEARCHPATH macro. The default list is:

/lib /usr/lib /usr/shlib

It is not uncommon for bind libraries to be installed in nonstandard locations. If such is the case at your site, you can add that nonstandard location to this list with:

APPENDDEF(`confLIBSEARCHPATH', `/usr/local/lib/bind')

If your new location is more important than those in the default list, you can insert that location ahead of the others:

PREPENDDEF(`confLIBSEARCHPATH', `/usr/local/lib/bind')

Achieving the effect you seek can be time-consuming. You will need to rerun Build and observe its output until that effect is displayed.

confLN

Program to link files Build macro

As part of installing the sendmail suite of programs, some symbolic links have to be established. The program to create those symbolic links is called ln(1).

If you prefer to use a different program to create symbolic links, you can do so by defining, as shown here, a new program to use:

define(`confLN', `/usr/local/bin/ln')

Before specifying a new program, however, be sure that its command-line arguments (see the next section) are compatible with those used by the default program.

Prior to V8.12.5, this install macro could be used only for libmilter, not for the confLINKS programs (confLINKS on page 84). This has been fixed as of V8.12.6, and this install macro can be used for all the programs.

confLNOPTS

Switches for the program to link files Build macro

As part of installing the sendmail suite of programs, some symbolic links have to be established. The program to create those symbolic links is usually called ln(1), but it can be renamed with the confLN macro described in the previous section.

The default arguments given to the program are -f -s followed by the name of the file to symbolically link. You can change those arguments by using this confLNOPTS Build macro:

define(`confLNOPTS', `-s')

Here, we removed the -f switch, which forces an unconditional link. Another use for this confLNOPTS Build macro would be to devise arguments for a different or custom linking program (see the previous section).

What to link to sendmail Build macro

A few different names need to be created to make sendmail easier to use. Shown in Table 2-7, they are created by symbolic links to the sendmail binary (except smtpd, which is not automatically linked).

Table 2-7. Symbolic links to sendmail

Name

Description

hoststat

Print persistent host status.

mailq

Display the queue.

newaliases

Initialize alias database.

purgestat

Purge persistent host status.

smtpd

Run as a daemon.

The names and locations of these links are defined with the confLINKS macro. The default values are:

${UBINDIR}/newaliases ${UBINDIR}/mailq ${UBINDIR}/hoststat ${UBINDIR}/purgestat

Here, ${UBINDIR} is separately defined with the confUBINDIR macro (confUBINDIR on page 100). For example, if you wished to put all the links in /usr/local/bin and wanted to add smtpd to the list, you could do this:

define(`confUBINDIR', `/usr/local/bin')
APPENDDEF(`confLINKS', `${UBINDIR}/smptd')

But be forewarned that if you put the links in a new location, you should probably also remove the old links from the former default location. Also note that -E DESTDIR (DESTDIR= on page 349) can be used to relocate all installation directories.

confMAN...

How to install manual pages Build macros

Online manual pages are installed in various ways and in various locations based on the version of Unix involved. For most installations, the defaults defined in your devtools/OS file will be perfect for your site. In the unlikely event that you prefer different settings, a wide range of Build macros is available (see Table 2-8).

Table 2-8. Build macros for online manual pages

Macro

§

Default

Description

confMAN1

Where to install the manuals on page 86

1

confMANROOT extension for mailq, vacation, and newaliases

confMAN1EXT

Adding tags to the manual on page 87

1

Installed extension for mailq, vacation, and newaliases

confMAN1SRC

The formatted source files on page 86

0

Source extension for mailq, vacation, and newaliases

confMAN4

Where to install the manuals on page 86

4

confMANROOT extension for devices

confMAN4EXT

Adding tags to the manual on page 87

4

Installed extension for devices

confMAN4SRC

The formatted source files on page 86

0

Source extension for devices

confMAN5

Where to install the manuals on page 86

5

confMANROOT extension for aliases

confMAN5EXT

Adding tags to the manual on page 87

5

Installed extension for aliases

confMAN5SRC

The formatted source files on page 86

0

Source extension for aliases

confMAN8

Where to install the manuals on page 86

8

confMANROOT extension for sendmail, mail.local, praliases, makemap, mailstats, rmail, editmap, and smrsh

confMAN8EXT

Adding tags to the manual on page 87

8

Installed extension for sendmail, mail.local, praliases, makemap, mailstats, rmail, editmap, and smrsh

confMAN8SRC

The formatted source files on page 86

0

Source extension for sendmail, mail.local, praliases, makemap, mailstats, rmail, editmap, and smrsh (V8.9.1 and above)

confMANDOC

Which macro package to use when formatting on page 88

Auto-determined

Macros used to format manpages

confMANGRP

Permissions and ownership of the installed manuals on page 87

Bin

The group of installed manpages

confMANMODE

Permissions and ownership of the installed manuals on page 87

0444

The mode of installed manpages

confMANOWN

Permissions and ownership of the installed manuals on page 87

Root

The owner of installed manpages

confMANROOT

Where to install the manuals on page 86

OS-dependent

The base of the online manual directories

confMANROOTMAN

Where to install the manuals on page 86

OS-dependent

The base of the unformatted manual directories

The formatted source files

All the manuals that are supplied in the sendmail distribution are in troff(1) input format. Before these files can be installed, each must be formatted using the command defined by confNROFF (Program and arguments used for formatting on page 88), with the macro package defined by confMANDOC (Which macro package to use when formatting on page 88). In the following example, sendmail.8 is the troff source being formatted:

${NROFF} ${MANDOC} sendmail.8 > sendmail.${MAN8SRC}

The formatted manual is placed into a file with the same base name as the input file, but with a new tag as defined by the confMAN8SRC macro. Section 1 manuals use the confMAN1SRC macro, section 5 manuals use the confMAN5SRC macro, and section 8 manuals use the confMAN8SRC macro. In general, the confMAN*SRC macros should not be redefined[48] unless you have a pressing need to do otherwise. For example, consider:

define(`confMAN1SRC', `txt')
define(`confMAN4SRC', `txt')
define(`confMAN5SRC', `txt')
define(`confMAN8SRC', `txt')

which would produce a formatting command that looks like this for sendmail.8:

${NROFF} ${MANDOC} sendmail.8 > sendmail.txt

The confMAN*SRC macros are also used when the manual pages are installed. In the following example (which again uses sendmail.8 as the troff source), the formatted manuals are copied with install(1) like this:

${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} sendmail.${MAN8SRC} ${MAN8}/sen
dmail.${MAN8EXT}

Where to install the manuals

Each of the three manual sections has a directory where the formatted files should be installed. For section 1, for example, that directory is usually either /usr/man/cat1 or /usr/share/man/cat1. The appropriate directories are usually predefined for you in your devtools/OS file. In the rare event that you wish to base your formatted directories elsewhere, you can define different directories using confMANROOT and one of three confMANdigit macros. For example, consider this method of moving your previously formatted manuals to /usr/local/man:

define(`confMANROOT', `/usr/local/man/cat')

The confMANdigit and confMANROOT macros are used when the manual pages are installed. Here, using newaliases.1 as the example, the formatted manuals are copied with install(1):

${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} newaliases.${MAN1SRC} \
        ${MAN1}/newaliases.${MAN1EXT}

The directory ${MANdigit} is a concatenation of the confMANROOT macro and a confMANdigit macro. If, for another example, you want all manuals to go in a single directory, you might do something like this:

define(`confMANROOT', `/usr/local/manuals')
define(`confMAN1', `')
define(`confMAN4', `')
define(`confMAN5', `')
define(`confMAN8', `')

Note that confMAN1, confMAN4, confMAN5, and confMAN8 can also be full pathnames if you set confMANROOT to nil. This might be useful if you install manuals in highly unusual paths:

define(`confMANROOT', `')
define(`confMAN1', `/usr/man/users')
define(`confMAN4', `/usr/man/libraries')
define(`confMAN5', `/usr/man/files')
define(`confMAN8', `/usr/man/sysadmin')

Also note that -E DESTDIR (DESTDIR= on page 349) can be used to relocate all installation directories.

Finally, note that there is a special macro for setting the location of the unformatted manuals. It is called confMANROOTMAN, and one way to use it is like this:

define(`confMANROOTMAN', `/usr/local/man/man')

Here, we change the location for the unformatted manual pages from the usual (for Solaris) /usr/share/man/man to a new location in /usr/local.

Adding tags to the manual

The name of each of the three manual sections ends in a dot followed by a suffix. Those suffixes are usually digits that are set with a confMAN*EXT macro. The appropriate suffixes are usually preset for you in your devtools/OS file. In the rare event you wish to use different suffixes, you can change them using one of the three confMAN*EXT macros. For example, if you wanted all the manuals in /usr/local/man to end with the suffix .man, you could do something like this:

define(`confMAN1EXT', `man')
define(`confMAN5EXT', `man'
define(`confMAN8EXT', `man')

The confMAN*EXT macros are used when the manual pages are installed. Here, using aliases as the example, formatted manuals are copied with install(1) like this:

${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} aliases.${MAN5SRC} \
       ${MAN5}/aliases.${MAN5EXT}

Permissions and ownership of the installed manuals

The manual pages have their permissions, ownership, and group set with the corresponding confMANMODE, confMANOWN, and confMANGRP macros. These are usually correctly preset for your system in your devtools/OS file, but sometimes you might prefer different settings.

In the following example, we install all manuals owned by man and the group man with group write permissions:

define(`confMANMODE', `464')
define(`confMANOWN', `man')
define(`confMANGRP', `man')

For most versions of the install(1) program, the ownership and group must be specified by name. If you use the devtools/bin/install.sh script to install (confINSTALL on page 79), you can use appropriate integers in place of names.

Program and arguments used for formatting

The troff(1) program is used to format the manual pages. That program comes in several flavors, the most typical of which are the nroff(1) and groff(1) programs. The default is:

groff -Tascii

If your site lacks the groff(1) program, you can substitute nroff like this:

define(`confNROFF', `nroff')

If, for some reason, you don’t want to format the manuals, you can use the confNO_MAN_BUILD (confNO_MAN_BUILD on page 92) macro. If, for some reason, you don’t want to install the manuals, you can use the confNO_MAN_INSTALL (confNO_MAN_INSTALL on page 93) macro.

Which macro package to use when formatting

Prior to V8.10, sendmail manuals had to be formatted with the tmac.andoc package, usually located in the /usr/lib/tmac directory. Beginning with V8.10 sendmail, the manual pages are formatted with the standard Tmac.an macros, just like all your other online manuals.

If, for some reason, your site calls that macro package by a different name (but with the same function), you can specify the different command-line argument with the confMANDOC macro:

define(`confMANDOC', `-newman')

Note that you cannot format with the tmac.s (-ms) or tmac.e (-me) macro package.

confMAPDEF

Which database libraries to use Build macro

The confMAPDEF macro defines the database library support you want. The currently available choices are listed in Table 2-9. Details are given in the section indicated.

Table 2-9. Define for database support

Define

§

Alias[a]

Description

[a]
[b]

AUTO_NIS_ALIASES

AUTO_NIS_ALIASES on page 109

Yes

Add fallback alias techniques.

DNSMAP

dns on page 905

No

Support dns database maps (V8.12 and above).

HESIOD

HESIOD on page 115

Yes

Support hesiod database maps.

LDAPMAP

LDAPMAP on page 119

Yes

Enable use of ldap databases.

MAP_REGEX

MAP_REGEX on page 125

No

Enable matching to a map that is a regular expression (V8.9 and above).

MAP_NSD

-z on page 929

No

Support Adding tags to the manual on page 86 IRIX 6.5 name service maps (V8.10 and above).

NDBM

NDBM on page 125

Yes

Support Unix ndbm(3) databases.[b]

NETINFO

NETINFO on page 127

Yes

Support NeXT netinfo(3) databases.

NEWDB

NEWDB on page 128

Yes

Support db(3), both hash and btree forms.

NIS

NIS on page 128

Yes

Support nis maps.

NISPLUS

NISPLUS on page 129

Yes

Support nisplus maps.

PH_MAP

ph on page 930

No

UIUC ph database (V8.10 and above).

SOCKETMAP

SOCKETMAP on page 145

No

Use socket-based databases.

UDB_DEFAULT_SPEC

UDB_DEFAULT_SPEC on page 149

n/a

Default user database location.

USERDB

USERDB on page 150

n/a

Support the user database.

[a] If yes, this database format supports aliasing.

[b] Note that the old dbm(3) form of database is no longer supported.

If neither NDBM nor NEWDB is defined, sendmail will read the aliases into its symbol table every time it starts. This will make sendmail crawl every time it starts up and is not recommended.

External databases can be extremely valuable, especially in providing easy solutions for complex problems. Therefore, we recommend that you include a definition for all databases that your system supports, even if you don’t immediately see a need for them.

Here we illustrate the selection of two forms of database:[49]

APPENDDEF(`confMAPDEF', `-DNEWDB -DNDBM')

When these two forms are selected, old databases are read by using NDBM, but new databases are created by using NEWDB. Read sendmail/README for details about and exceptions to this transition process.

confMBIN...

Where and how to install sendmail Build macro

The sendmail binary is intended to run as root only when root runs it. The directory that it is installed in, and the permissions that it has, are defined by four macros:

confMBINDIR

The confMBINDIR macro determines where the sendmail program will be installed. For most sites, the correct directory will be defined in your devtools/OS file. But if you decide to put sendmail in a different directory, you can do so by defining this macro:

define(`confMBINDIR', `/export/local/sos5.6/clients/sbin')

In general, whenever you relocate the sendmail program, you should also examine your /etc/rc or /etc/init.d scripts. They often contain built-in path assumptions that will need to be changed to match the new path. If you fail to change those scripts, the new sendmail will not be automatically started at boot time.

Note that many mail user agents (MUAs) also hardcode assumptions about where sendmail is located. Check every MUA on your machine to be certain none of them will break because of the new location. Some, such as /usr/ucb/Mail, have configuration files of their own that define sendmail’s location. You will need to find and fix those separate configuration files too.

Lastly, note that -E DESTDIR (DESTDIR= on page 349) can be used to relocate all installation directories.

confMBINGRP

This macro sets the group that sendmail should belong to. The group defaults to bin. If you wish to use a different group you can do so like this:

define(`confMBINGRP', `mbin')          ← use a group name
define(`confMBINGRP', `343')           ← use a group number

If you use a positive number that is not too large, it will be accepted no matter what. If you use a name that is not defined in the /etc/group file, you might see the following error and the build will fail:

chgrp: nullmail: unknown group
confMBINMODE

This macro defines the execution mode that sendmail will have. The default is mode 550, which is readable and executable by the owner and group only. One reason to change this default might be to allow ordinary users to execute the program. You would make such a change like this:

define(`confMBINMODE', `551')          ← add user execute permission

If you use an illegal permission value, such as 991, you will see the following error and the build will fail:

chmod: invalid mode
confMBINOWN

This macro defines who will own the sendmail binary. The default is root. You can set its ownership to a different owner if you prefer, with an m4 Build macro like this:

define(`confMBINOWN', `bin')          ← use a username
define(`confMBINOWN', `9')            ← use a user number

If you use a positive number that is not too large, it will be accepted no matter what. If you use a name that is not defined in the /etc/passwd file (or in a related file such as /etc/shadow), you might see the following error and the build will fail:

chown: unknown user id: nomail

Beware, however, that you should not change the owner from root without first carefully considering the possible security risks.

confMKDIR

Program to create installation directories (V8.14 and later) Build macro

By default, if this confMKDIR build macro is undefined, the system’s mkdir(1) program is executed with a -p argument to create installation directories as needed. The -p causes intermediate directories to also be created as needed, and prevents an error if a directory to be created already exists.

Beginning with V8.14, you may use this confMKDIR build macro to replace the default with a program of your own, perhaps a GNU version of mkdir(1):

define(`confMKDIR', `/usr/local/bin/mkdir')

Be aware, however, that installation is usually run by root, so avoid defining a shell script that lives in an unsafe directory.

confMSPQOWN

Owner of the MSP queue Build macro

The non-set-user-id root version of sendmail used for local mail submission employs a queue that is separate from that used by the mail transfer agent (MTA) daemon. This separate queue is owned by smmsp (by default). If you prefer a different owner, you can redefine it with this confMSPQOWN Build macro. It is used like this:

define(`confMSPQOWN', `nullmail')       ← define a username
define(`confMSPQOWN', `67541')          ← define a user by number

If you specify an owner by a positive number that is not too large, it will usually work. If you define a name that is not in the /etc/passwd file (or in a related file such as /etc/master.passwd), the following error will print and the build will fail:

chown: unknown user id: nullmail

See also confMBINOWN in confMBIN... on page 89.

confMSP_QUEUE_DIR

Location of the MSP queue Build macro

The non-set-user-id root version of sendmail used for local mail submission employs a queue that is located separately from that used by the MTA daemon. This separate queue is located by default in /var/spool/clientmqueue. If you prefer a different location or name, you can redefine it with this confMSP_QUEUE_DIR Build macro. Two ways to redefine it might look like this:

define(`confMSP_QUEUE_DIR',`/var/spool/mspqueue')           ← change the name
define(`confMSP_QUEUE_DIR',`/disk1/spool/clientmqueue')     ← change the location

Note that by renaming or relocating the queue directory with this confMSP_QUEUE_DIR Build macro, the MSP_QUEUE_DIR mc macro must also be placed into the submit.mc file and a new submit.cf file thereafter built:

MSP_QUEUE_DIR(`/var/spool/mspqueue')

confMSP_STFILE

Define MSP statistics file (V8.12.6 and later) Build macro

Beginning with V8.12.6 sendmail, the confMSP_STFILE Build macro may be used to define a new name under which the statistics file (StatusFile on page 1095) used by the MSP (The submit.cf File on page 66) invocation of sendmail can be installed. It is used like this:

define(`confMSP_STFILE', `mspstats')

Here, a statistics file with the new name mspstats will be installed in the default directory /var/spool/clientmqueue (unless you redefine the default directory using the confMSP_QUEUE_DIR [confMSP_QUEUE_DIR on page 91] Build macro). The default name for this statistics file is sm-client.st.

Note that if you rename this MSP statistics file, you will also have to redefine the StatusFile option (StatusFile on page 1095) in the submit.cf file (The submit.cf File on page 66) to reflect the new name. The proper way to modify that file is to first edit the cf/cf/submit.mc file in the source distribution, and then to regenerate a new submit.cf file, as shown next.

# cd cf/cf
... edit the submit.mc file here
 # make install-submit-cf
... the submit.cf file is re-created and installed here

See also the mailstats program and its -c command-line switch (-c on page 367), which is used to print the contents of this statistics file.

confMTCCOPTS

Compiler options for multithreading Build macro

Use of this macro is not supported in the open source version of sendmail.

confMTLDOPTS

Linker options for multithreading Build macro

Use of this macro is not supported in the open source version of sendmail.

confNO_HELPFILE_INSTALL

Prevent installation of the help file Build macro

Ordinarily, sendmail’s help file will be installed automatically. You can see this in part of Build’s output:

install -c -o bin -g bin -m 444 helpfile /etc/mail/helpfile

There are legitimate reasons to suppress the installation of this help file. Consider a site that has added legal disclaimers to that file. Such a site might wish to leave the modified file in place, and prevent it from being overwritten during installation of sendmail. To prevent installation of the help file, you can define this confNO_HELPFILE_INSTALL macro:

define(`confNO_HELPFILE_INSTALL')

With this line in your m4 build file, the preceding install line will be eliminated during installation.

confNO_MAN_BUILD

Prevent formatting of manuals Build macro

Ordinarily, when you build sendmail, the unformatted manual pages (those that end in a digit other than zero) are formatted and overwrite the corresponding file that ends in zero. When you run Build it looks like this:

groff -Tascii -man sendmail.8 > sendmail.0 || cp sendmail.0.dist sendmail.0

If you don’t want to format the manual pages (that is, to leave the zero-suffixed files untouched), you can define this confNO_MAN_BUILD macro. Then, when you run Build, the preceding formatting line (or lines) will be missing.

confNO_MAN_INSTALL

Prevent installation of manuals Build macro

The confNO_MAN_INSTALL macro prevents Build from installing manual pages. In a shared environment, one might not want to install manuals. In that situation, it is preferable to install manuals once, in a central location, rather than installing them for each new machine that is later brought up. For example, the first machine’s m4 build file might contain this:

define(`confMANROOT', `/usr/local/man/cat')

Then, the m4 build files for all future machines might contain this:

define(`confNO_MAN_BUILD')
define(`confNO_MAN_INSTALL')

Here, the first line prevents the formatted manuals from being created. The second line prevents the nonexistent manuals from being installed.

confNO_STATISTICS_INSTALL

Prevent installation of the statistics file Build macro

The sendmail statistics file is ordinarily installed automatically:

cp /dev/null statistics
install -c -o bin -g bin -m 444 statistics /etc/mail/statistics

There are legitimate reasons to suppress the installation of this statistics file. Consider a site that has written custom software to monitor the sendmail program’s performance. Such a site might wish to eliminate the sendmail statistics file because it is redundant. To prevent installation of the statistics file, you can define this confNO_STATISTICS_INSTALL macro:

define(`confNO_STATISTICS_INSTALL')

With this line in your m4 build file, the earlier install line will be eliminated during installation.

confOBJADD

Extra .o files to be linked in all programs Build macro

The confOBJADD macro defines additional object files that need to be included in sendmail and the programs associated with it (such as praliases). It is very unlikely that you will ever have to change the value for it that is predefined in your devtools/OS file. An exception to this might occur if you need to replace a standard C-library function with one that is customized to satisfy some local need. For example, consider a replacement for the syslog(3) routine. First, place a copy of syslog.c in all the source directories. Then, add this line to your site file:

define(`confOBJADD', `syslog.o')

Note that the confOBJADD macro takes the .o form of the object filename, not the source file name.

If you forget to put a copy of the source in one of the directories, you will see this (or a similar) error at build-time:

make: Fatal error: Don't know how to make target `syslog.o'

confOPTIMIZE

How to optimize the compile Build macro

The confOPTIMIZE macro sets the command-line switch that will be passed to the C-language compiler to tune its optimization. This macro assigns a value to the O= Makefile directive. Normally, it is correctly set for your site in your devtools/OS file.

One reason to change optimization might be to track down a bug that is causing your installation of sendmail to core-dump. Just add this line to your site file, and re-Build with -c:

define(`confOPTIMIZE', `-g')

The -g switch causes the compiler to produce a binary that can later be debugged with a symbolic debugger.

Most often, sendmail core dumps are caused by improper builds. Always be sure to keep your system and compiler #include files up-to-date and in synchronization with their corresponding libraries.

Note that the confOPTIMIZE macro is not the proper place to set other compile-time macros. Instead use confENVDEF (confENVDEF and conf_prog_ENVDEF on page 75).

confRANLIB

The name of the ranlib program for library archive files Build macro

Some flavors of Unix require that the ranlib(1) program be run against a library, before that library can be used. For such systems, this confRANLIB macro is correctly defined for you to be ranlib. For other flavors of Unix, the ranlib(1) program is not necessary. For such systems, this confRANLIB macro is defined to be echo.

In the rare circumstance that the default definition is wrong for your site, you can change it by defining this confRANLIB macro:

define(`confRANLIB', `/afs/support/cc/ranlib')

confRANLIBOPTS

Arguments to give the ranlib program Build macro

Many versions of the ranlib(1) program run successfully with no argument other than the name of the library file. On some other systems (notably Darwin and Rhapsody), the ranlib(1) program requires a -c argument before the library name. For all the supported architectures in devtools/OS, the presence or absence of other switches is correctly defined for you.

In the rare circumstance that you need to add or change a switch, you can do so with this confRANLIBOPTS macro:

define(`confRANLIBOPTS', `-v')         ← replace the switch
APPENDDEF(`confRANLIBOPTS', `-v')      ← add a switch

confREQUIRE_LIBSM

Define if libsm is required Build macro

Some of the programs in the source distribution, such as sendmail, require the libsm/libsm.a library. For those programs, this confREQUIRE_LIBSM build-time macro is already correctly defined.

Should you develop a program of your own that needs this library, you can modify its Makefile.m4 file to include it.

confSBINDIR

root-oriented program directory Build macro

Programs that should be executed only by root are considered "root-oriented.” Among those programs are editmap, makemap, mailstats, and praliases. Such programs are installed in a directory whose name is defined by the confSBINDIR macro. In general, this macro is correctly defined for you in your devtools/OS directory, but if you wish to install one or more of those programs in a different location, you can do so like this:

define(`confSBINDIR', `/opt/mail/sbin')

Here, we have defined the appropriate macros to force installation of the root-oriented programs in the /opt/mail/sbin directory. Naturally, this directory must be properly created ahead of time.

Note that -E DESTDIR (DESTDIR= on page 349) can be used to relocate all installation directories.

confSBINGRP

Group for set-user-id programs Build macro

The sendmail program often needs to run with appropriate group permissions to be able to determine the load average. On SunOS systems, for example, it needs to run as group kmem. The appropriate group is correctly defined for you in your devtools/OS file, but if you need to change that group, you can do so with this confSBINGRP macro:

define(`confSBINGRP', `mail')

confSBINMODE

Permissions for set-user-id programs Build macro

For the desired set-user-id behavior to occur, appropriate permissions need to be set during installation. The default permission is 4555. If you wish to change this default, you can do so with the confSBINMODE macro:

define(`confSBINMODE', `2555')          ← not recommended

Be aware that disabling set-user-id like this can cause some actions to fail, such as reading ~/.forward files or writing to the queue.

confSBINOWN

Owner for set-user-id programs Build macro

Two programs need to be executed as root no matter who runs them. One is sendmail (prior to V8.12), and the other is mail.local. Should one or both of these programs have to run as a user other than root, you can redefine the user with this confSBINOWN macro:

define(`confSBINOWN', `nullmail')

Note that this is just half of the solution. You will also need to tune the appropriate F=S delivery agent flag (see F=S on page 780 for a description of how to do this).

confSHAREDLIB...

Shared library definitions Build macro

Future versions of sendmail might be able to use shared libraries. When they do, it will be possible to tune their specifications with the build-time macros shown in Table 2-10.

Table 2-10. Shared library build-time macros

Macro

Description

confSHAREDLIB_EXT

The shared library extension (generally .so)

confSHAREDLIB_SUFFIX

The suffix that shows the version of the shared library

confSHAREDLIBDIR

The directory into which to install shared libraries

confSHELL

SHELL= for Makefile Build macro

The confSHELL macro is used to assign a value to the SHELL= directive in the created Makefile. That directive determines the shell that will be used to execute each command. The default is /bin/sh for most systems, and /usr/bin/sh for a few. In the extremely rare circumstance that the Bourne shell is not available in this standard location, or if you wish to use a different shell for building sendmail, you can redefine the shell using this confSHELL macro. For example:

define(`confSHELL', `/usr/local/bin/sh')

Note that use of any shell other than the Bourne shell might have unexpected results. Also note that the -E switch to Build cannot be used to pass this value in the environment.

confSM_OS_HEADER

Platform-specific #include file Build macro

The name of the operating-system-specific #include file needed to compile sendmail is normally correctly set for you in your devtools/OS file. You will need to define this for yourself only if you are porting sendmail to an entirely new platform.

confSMOBJADD

Extra .o files to be linked in sendmail Build macro

This macro is deprecated in favor of the conf_prog_OBJADD macro described later.

confSMSRCADD

Source files that correspond to confSMOBJADD Build macro

This macro is deprecated in favor of the conf_prog_SRCADD macro described later.

confSONAME

Shared object ld flag Build macro

This is the command-line switch used with the ld(1) command to create a shared library. Under FreeBSD and Linux it defaults to -soname, and under Solaris it defaults to -h. This Build macro is not currently used by the open source version of sendmail.

conf_prog_OBJADD

Extra .o files to be linked per program Build macro

The conf_prog_OBJADD macro defines additional object files that need to be included in a particular program. Note that it differs from the confOBJADD macro (see confOBJADD on page 93), which adds object files to all programs:

define(`conf_sendmail_OBJADD', `myfilter.o')

Here, we add an object to the object list for the sendmail program only. If this object needs to be generated from a source file, that source file should also be listed with conf_prog_OBJADD, described later.

It is very unlikely that you will ever have to change this value from the one that is predefined for you in your devtools/OS file.

conf_prog_SRCADD

Source that corresponds to conf_prog_OBJADD Build macro

If you ever add .o files to conf_prog_SRCADD (described earlier), and if those .o files need to be generated from .c files, you will need to list those corresponding .c files here:

define(`conf_sendmail_SRCADD', `myfilter.c')

Here, we add a source file to the source file list for the sendmail program only. To add source files to all programs, eliminate the _prog_ and use confSRCADD instead.

It is very unlikely that you will ever have to change this value from the one that is predefined for you in your devtools/OS file.

confSRCDIR

Location of sendmail source Build macro

All the auxiliary programs that are supplied with sendmail (such as mail.local and praliases) need pieces of source from the sendmail source directory to compile. The location of that directory defaults to ../../sendmail.[50] Should you need to relocate that source tree (as you might, for example, if you wished to do extensive source modification in a new directory), you can redefine the source location with this confSRCDIR macro:

define(`confSRCDIR', `../../newsendmail')

Note that confSRCDIR gives a value to the SRCDIR= Makefile directive, and that make is run inside an obj... directory, hence the ../../ prefixing newsendmail.

Should you need to relocate the sendmail source to a totally different disk or machine, you must define confSRCDIR as a full pathname:

define(`confSRCDIR', `/usr/local/devel/sendmail/custome1.5/src')

Be careful never to define confSRCDIR under a temporary mount point, such as tmp_mnt, because that mount point might not exist the next time you try to Build. And note that SRCDIR= is always the current directory for sendmail, so nothing special needs to be done to Build if you move the source.

confSTDIOTYPE

Use torek or portable for buffered file I/O Build macro

This build-time macro is no longer used as of V8.12 sendmail.

Prior to V8.10 sendmail, xf transcript files were always created on disk for each delivery, regardless of whether any information ever ended up in them. In fact, 99% of the time, the xf transcript is created and discarded without ever having been used. Unfortunately, the sendmail queue directory is disk-based, and therefore is limited in the number of I/O operations possible per second. Creating and removing useless files is expensive and has been shown to slow down sendmail.

Beginning with V8.10 sendmail it is possible to create and remove xf transcript files in memory, rather than on disk, and place them on disk only if they become large or need to be archived. This was made possible by the torek I/O library supplied with UCB 4.4 versions of Unix. For such versions, that library is used to create a memory-based file I/O inside sendmail, and thus speed up sendmail.

On the downside, for systems that lack the torek I/O library, this memory-based disk I/O is not available. Such systems are those based on System V or pre-4.4 BSD Unix, or Linux.

For all the flavors of Unix supported in devtools/OS, the selection of the type of I/O is correct. In the rare circumstance that you need to change this setting, you can do so with this confSTDIOTYPE macro:

define(`confSTDIOTYPE', `torek')         ← select torek I/O
define(`confSTDIOTYPE', `portable')      ← select non-torek I/O

If your Unix supports torek I/O, you will benefit in some additional ways. In addition to xf transcript files (The Transcript File: xf on page 401), datafiles (df files) are also buffered (The Data (Message Body) File: df on page 398). In future releases of sendmail, other transient files might also be buffered in memory.

If your Unix lacks torek I/O, you can still minimize the impact of xf files by moving them to a memory-based filesystem, such as tmpfs. This is done with the QUEUE_DIR configuration option’s wildcard extension for multiple queues (see Using qf, df, and xf Subdirectories on page 403).

As of V8.12, in-memory buffering of files is universal and no longer requires this Build macro.

confSTDIR

Location of the statistics file Build macros

The confSTDIR macro defines the location (directory) where the sendmail program’s statistics file will be found (see The statistics File on page 365 for a description of this file). The confSTDIR macro assigns its value to the STDIR Makefile directive. It is very unlikely that you will ever have to change this from the value that is predefined for you in your devtools/OS file. But one reason to relocate this file would be the need to locate it on a read/write disk, where /etc/mail is mounted read-only:

define(`confSTDIR', `/var/run/statistics')

Note that if you redefine this directory, you must also redefine the STATUS_FILE configuration macro (The statistics File on page 365) so that the correct path appears in your sendmail.cf file’s StatusFile option.

Also note that -E DESTDIR (DESTDIR= on page 349) can be used to relocate all installation directories.

confSTFILE and confSTMODE

The name and mode of the statistics file Build macro

The confSTFILE macro defines the name of the sendmail program’s statistics file (see The statistics File on page 365). Normally that name is statistics. It is very unlikely that you will ever have to change this predefined value, but one reason to change the name might be a desire to use a more traditional name:

define(`confSTFILE', `sendmail.st')

Note that, if you redefine this name, you must also redefine the STATUS_FILE configuration macro (The statistics File on page 365) so that the correct name appears in your sendmail.cf file’s StatusFile option.

Beginning with V8.12.4 sendmail, the confSTMODE Build macro has been added to specify the initial permissions for the statistics file. The default permissions are 0600 (read/write only for the owner). These are the recommended permissions, but you might prefer slightly looser permissions if you wish to allow others to read that file with the mailstats program. To change the default, add a line such as the following to your Build m4 file:

define(`confSTMODE', `0640')

It’s OK to allow others to read the file, but it is never OK to allow others to write to that file. Although even looser permissions—say, 0644—might appear desirable, we discourage them because they can allow for a denial-of-service attack on the local machine.

confSTRIP

The name of the program to strip the binary Build macro

This is the name of the strip(1) program, which removes symbol-table information from a program and creates a smaller binary. The default is the name strip. To strip a program with Build, install it with install-strip instead of install:

% ./Build install-strip
Configuration: pfx=, os=SunOS, rel=4.1.3, rbase=4, rroot=4.1, arch=sun4, sfx=
Making in ../obj.SunOS.4.1.3.sun4/praliases
install -c -o bin -g bin -m 555 praliases /usr/etc
strip  /usr/etc/praliases                                      ← note

In rare circumstances, you might need to use a different program or a differently located version of strip to perform this function. You change strip with the confSTRIP build macro:

define(`confSTRIP', `/usr/new/44BSD/strip')

If you wish to always strip the binary, you can use the confLDOPTS macro (see confLDOPTS on page 80 for a description of this end-run).

confSTRIPOPTS

Command-line arguments for the strip program Build macro

Some versions of strip(1) offer options in the form of command-line switches. Solaris 5.5, for example, has a version of strip(1) that supports an -x switch (among others), which causes debugging and line numbers to be stripped, but not the symbol table. If you wished to add this switch to the invocation of strip(1), you could do so like this:

define(`confSTRIPOPTS', `-x')

See your online manual for strip(1) to find switches that might be suitable to your needs.

confUBINDIR

Location of user executables Build macro

User-executable programs are those that can be run without special permissions. The confUBINDIR macro determines where such programs will be installed. User programs for this macro are newaliases, mailq, hoststat, purgestat, vacation, and rmail. (Note that editmap, mailstats, makemap, and praliases use confSBINDIR, and that smrsh and mail.local use confEBINDIR.) The confUBINDIR macro is usually correctly defined inside your devtools/OS file. To redefine it, simply enter in your m4 build file a line that looks something like this:

define(`confUBINDIR', `/usr/local/bin')

Be forewarned, however, that if you relocate these programs, you might also have to remove earlier installed or vendor-supplied versions to avoid having users running the wrong programs. And note that -E DESTDIR (DESTDIR= on page 349) can be used to relocate all installation directories.

confUBINGRP

Group for user executables Build macro

The confUBINGRP macro determines the group ownership of user-executable files. This macro assigns its value to the BINGRP= Makefile directive, but only for the following programs: editmap, mailstats, makemap, praliases, rmail, vacation, and smrsh. This macro is usually correctly defined for you in your devtools/OS file. To change the group for these programs, you might do this:

define(`confUBINGRP', `users')

Note that the newaliases, mailq, hoststat, and purgestat programs are really symbolic links, so the concept of group does not apply.

confUBINMODE

Permissions for user executables Build macro

The confUBINMODE macro determines the permissions for user-executable files. This macro assigns its value to the BINMODE= Makefile directive, but only for the following programs: editmap, mailstats, makemap, praliases, rmail, vacation, and smrsh. This macro is usually correctly defined for you in your devtools/OS file. To change the permissions for these programs, you might do this:

define(`confUBINMODE', `111')

Note that the newaliases, mailq, hoststat, and purgestat programs are really symbolic links, so the concept of permissions does not apply.

confUBINOWN

Ownership of user executables Build macro

The confUBINOWN macro determines the ownership of user-executable files. This macro assigns its value to the BINOWN= Makefile directive, but only for the following programs: editmap, mailstats, makemap, praliases, rmail, vacation, and smrsh. This macro is usually correctly defined for you in your devtools/OS file. To change the ownership of these programs, you might do this:

define(`confUBINOWN', `sendmail')

Note that the newaliases, mailq, hoststat, and purgestat programs are really symbolic links, so the concept of ownership does not apply.

PREPENDDEF( )

Prepend to an existing define Build directive

The PREPENDDEF( ) m4 directive allows you to insert new information before that which was previously defined. To illustrate, consider a custom C-language library you want searched first during the loading phase of compiling, where the default list of libraries (for SunOS.5.7) looks like this:

-lsocket -lnsl

If you need to insert another library at the head of this list, without erasing what is already there, you can use this PREPENDDEF( ) directive:

PREPENDDEF(`confLIBS', `-llocal')

This causes the previous declaration to be prefixed with a new (third) library:

-llocal -lsocket -lnsl

Note that you can safely use this PREPENDDEF( ) directive when in doubt as to whether a macro has been given a value by default because no harm can be caused by prepending to an empty definition. (See also APPENDDEF( ) in APPENDDEF( ) on page 69.)



[26] * Your installed path might differ. Under Solaris Unix, for example, sendmail is located in /usr/lib.

[27] * How public key cryptography is used to sign a file is described in Public Key Cryptography on page 199.

[28] * Further information about how solve problems when using PGP can be found in PGP: Pretty Good Privacy, by Simon Garfinkel (O’Reilly), http://www.oreilly.com/catalog/pgp/.

[29] * Application Programming Interface (a communication protocol between software components).

[30] * Note that the date of the release is in the form year (first), month, and day.

[31] * But the SECURITY keyword can, and generally does, describe the binary too.

[32] * This same Build script is also used to build all the support programs, such as mailstats, smrsh(1), and mail.local(1). We describe support programs in Chapter 10 on page 346.

[33] * Some operating systems put make in odd locations. If you can’t find it easily, check in /usr/local/bin, or under Solaris look in /usr/ccs/bin. Also under Solaris you might lack a compiler altogether. If so, see http://sunfreeware.com.

[34] * 8.3.3 and 9.2.1 are available from http://www.isc.org/products/bind/.

[35] * We no longer cover pre-V8.12 installation in this book.

[36] * The name submit.cf is hardcoded and cannot be changed.

[37] The name sendmail.cf can be changed with the _PATH_SENDMAILCF build macro (_PATH... on page 131).

[38] * If you prefer to avoid running two daemons, you can run the second invocation from cron, something like the following:

* * * * 0,30 /usr/sbin/sendmail -L msp-queue -Ac -q

[39] * Creating and installing submit.cf has been added as a convenience for you, to simplify the transition to this new non-set-user-id root model.

[40] * Although it contains as part of its name SENDMAILCF, this macro is used only to define the directory for the submit.cf file.

[41] If you need to make post-installation adjustments, we recommend you maintain your own Makefile outside the sendmail source distribution. That way, you can always replicate those adjustments even when the source tree is updated with later releases of sendmail.

[42] * V8 sendmail can read old queue files but might be unable to read some vendor queue files. If this is a problem, you might have to run the old and new versions in parallel (with separate queue directories) until the old queue has been emptied.

[43] * There is no method provided with the m4 technique to automatically patch hooks into sendmail. This is still a manual process.

[44] * Note that, once excluded, support cannot easily be included later by using options. It might be better to turn some facilities, such as identd(8), off and on with options rather than compiling them out. See Timeout.ident (V8.6 and later) on page 1104 for a description of the Timeout.ident option.

[45] The Build script magically changes the dot into an underscore to keep m4 from complaining.

[46] * This is why defining -DNEWDB with confENVDEF sometimes causes two -DNEWDBs to appear when compiling.

[47] Look in devtools/README and in devtools/M4/header.m4 to see how it has been predefined, before redefining it.

[48] * Due to an omission in V8.9, these can be redefined only as of V8.9.1.

[49] * Note that Build will automatically define -DNEWDB for you, if it can find the db(3) library (see confLIBSEARCH, confLIBSEARCH on page 82). You can suppress this automatic behavior (and the automatic search for a resolver library) by adding an -S command-line switch when you run Build (-S on page 353).

[50] * Prior to V8.10 the default was ../../src.