Virtually every Unix under the sun (no pun intended) comes with some version of sendmail installed, be it Berkeley or some other variant. The problem is that often this version is either out of date, hacked by the vendor, or both. In fact a Linux distribution is possibly the only Unix around which bundles a current (version 8.7), straight Berkeley sendmail. This poses a number of problems. First and foremost, because of the way sendmail works, it is renowned for having security holes. These holes are quickly ferreted out and fixed, but they are fixed by new releases of the program, so if a vendor provides an older release, it is quite possibly insecure. Another problem is that in any site, particularly large ones, it is always easier to start diagnosing problems from one common point, than many disparate ones. If all systems run a different revision of sendmail it complicates diagnosing a problem tremendously. So, for several reasons, it's a good idea to install the latest release of sendmail on all your systems.
The latest sendmail source is available for FTP from Berkeley at <URL:ftp://ftp.cs.berkeley.edu/ucb/sendmail/>. The source distribution is split up into several subdirectories for various purposes, such as documentation and extra, contributed programs. The two most important subdirectories are src, which contains the source for the sendmail program itself, and cf, which contains all the files needed to build a sendmail configuration file.
READ THE SOURCE DOCUMENTATION! This tutorial provides an overview for compiling and installing sendmail, but be sure to read the READ_ME files that come with the source distribution. They have additional information and are guaranteed to be up to date.
DO NOT compile sendmail with make. The instructions in the source repeat this warning several times, but it's worth repeating here as well. The Makefile is designed for the new Berkeley (4.4BSD) make program. Instead, use the program in the src subdirectory called makesendmail. This program finds an appropriate Makefile (from the src/Makefiles directory) for the current operating system from a subdirectory and builds sendmail from that, creating the files in a subdirectory named for the current operating system and processor type, e.g. obj.IRIX.5.3.IP22. This allows building for different operating systems from the same source directory, without mixing up object and executable files.
Many systems, including all of those covered in this course have a Makefile for makesendmail to use. So, compilation usually involves nothing more than invoking the makesendmail program with:
sh makesendmail
to compile, and invoking it again with:
sh makesendmail install
to install the freshly compiled binaries.
Less mainstream systems which don't have a specific Makefile, will require some tweaking of a Makefile from another system. The Makefiles are all relatively simple, so this shouldn't be too hard on the rare occasions that it is needed.
If they are needed, turning on certain features such as support for NIS or for different database formats will also require some Makefile tweaking. For more recommended information, see the Tweaking the Makefile page from Eric Allman's Sendmail Installation and Operation Guide. We have converted this entire guide from the troff source for your optional reference.
Sendmail needs a proper configuration file, called sendmail.cf, to work. Version 8.7 wants this file to be in /etc. Here's what the author, Eric Allman, has to say about this:
Up to 8.6, sendmail tried to find the sendmail.cf file in the same place as the vendors had put it, even when this was obviously stupid. As of 8.7, sendmail ALWAYS looks for /etc/sendmail.cf. You can get sendmail to use the stupid vendor .cf location by adding -DUSE_VENDOR_CF_PATH during compilation, but this may break support programs and scripts that need to find sendmail.cf. You are STRONGLY urged to use symbolic links if you want to use the vendor location rather than changing the location in the sendmail binary.
Upgrading from a vendor's sendmail, which already has a sendmail.cf to the latest Berkeley sendmail doesn't explicitly require a new config file, but often because of incompatibilities between versions, creating one will be necessary. Upgrading from a version previous to 8.7 (which will include most cases) will probably often need a new configuration file. Configuring a sendmail.cf file will be discussed further in a later section, but first check out this essential information from the Sendmail Installation and Operation Guide.
There are a few things about compiling from the source to be aware of:
Another installation option is to install from a pre-compiled distribution. The Unix Workstation Support Group at Indiana University has pre-compiled distributions of the latest sendmail for several systems, including all those covered in this course. These distributions are available on the UWSG FTP server in the various subdirectories of /pub/systems.
These distributions contain the compiled sendmail execution files, the manual pages, a choice of several different sendmail.cf files, and a Makefile to install all of these. People outside of IU should note that the sendmail.cf files we provide are often IU-specific, so they will need to be edited, or left uninstalled for non-IU systems.
Further information and explicit installation instructions are available in the documentation inside the distributions. Please read those instructions carefully before installing from the distribution. In particular, information on which of the several different sendmail.cf files to choose from will be interesting.
Terms used: sendmail, FTP, make, NIS, GNU.