UNIX System Administration Handbook - Evi Nemeth [335]
Version 8.9.3
Compiled with: MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7
NAMED_BIND NDBM NETINET NETUNIX NEWDB NIS NISPLUS QUEUE
SCANF SMTP USERDB XDEBUG
============== SYSTEM IDENTITY (after readcf) ==============
(short domain name) $w = katroo
(canonical domain name) $j = katroo.Sendmail.COM
(subdomain name) $m = Sendmail.COM
(node name) $k = katroo.Sendmail.COM
========================================================
sendmail should always use DNS MX (mail exchanger) records and will do so if compiled with the NAMED_BIND option (as in the preceding example).
sendmail installation
This section briefly describes the installation process; refer to the installation notes in the sendmail distribution for the gory details and for issues related to particular architectures or operating systems. If you are replacing your vendor’s version of sendmail, some of the configuration chores (such as installing help files) may already have been done for you.
The players:
• The sendmail binary, usually installed in /usr/sbin or /usr/lib. It runs setuid to root (mode 4755)
• The configuration file, /etc/mail/sendmail.cf, installed by the sysadmin
• The mail queue directory, /var/spool/mqueue (mode 700, owned by root), created manually by the sysadmin
• Various links to sendmail (newaliases, mailq, hoststat, etc.)
• sendmail’s safer local delivery agents, smrsh and mail.local, usually installed in /usr/libexec
You can download the latest version of sendmail from www.sendmail.org. To compile and install the package, run the Build script and then Build install.
Before you start compiling, however, you must decide on a database format and a strategy for interfacing sendmail with administrative databases such as NIS, NIS+, NetInfo, or even Hesiod. For on-disk databases, we recommend the Berkeley DB package specified in the Makefile as NEWDB. Don’t edit the Makefile, though; create your own site.config.m4 file to make customizations and set options. For example, if you intend to use LDAP, create a site.config.m4 file that contains:
define('confMAPDEF', '-DLDAPMAP')
define('confLIBS', '-lldap -llber')
And then compile sendmail with
# sh ./Build -c -f site.config.m4
See page 585 for more information about the nullclient feature.
sendmail should not normally be set up to be controlled by inetd and so it must be explicitly started in the rc files at boot time. A typical sequence is
if [-f /usr/sbin/sendmail -a -f /etc/mail/sendmail.cf];
then
(cd /var/spool/mqueue; rm -f [tTx]f*)
/usr/sbin/sendmail -bd -q30m &
echo -n ' sendmail' > /dev/console
fi
which checks for the sendmail binary and its configuration file and then starts the program in daemon mode. If your machine is not a mail server but still wants to run sendmail, you would configure it as a “nullclient” and would not run sendmail in daemon mode (no -bd flag); it therefore would not accept direct connections from the Internet.
This sh fragment should be added to the /etc/rc file on a Berkeley-based system or to /etc/init.d/sendmail on a System V system. If you like, you can use the fancier script in the installation guide, which tries to clean up previously interrupted queue runs.
This script assumes a single queue directory. If you have multiple queues, your script will be more complicated. See page 568 for more information about multiple queues.
Historically, sendmail’s supporting files have wandered around the filesystem to glamorous destinations such as /usr/lib, /etc, /usr/ucblib, and /usr/share. With the 8.10 release of sendmail, all files are expected to be kept beneath the /etc/mail directory.14
Let’s hope that vendors take the hint and leave them together in one consistent place.
The switch file
Many operating systems have a configuration file called the service switch that enumerates the methods that can be used to satisfy various standard