Basic Parts of sendmail
The sendmail program is actually composed of several parts, including programs, files, directories, and the services it provides. Its foundation is a configuration file that defines the location and behavior of these other parts and contains rules for rewriting addresses. A queue directory holds mail until it can be delivered. An aliases file allows alternative names for users and the creation of mailing lists. Database files can handle tasks ranging from spam rejection to virtual hosting.
The Configuration File
The configuration file contains all the information sendmail needs to do its job. Within it you provide information, such as file locations, permissions, and modes of operation.
Rewriting rules and rule sets also appear in the configuration file. They transform a mail address into another form that might be required for delivery. They are perhaps the single most confusing aspect of the configuration file. Because the configuration file is designed to be fast for sendmail to read and parse, rules can look cryptic to humans:
R $+ @ $+ $: $1 < @ $2 > focus on domain R $+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right
But what appears to be complex is really just succinct. The
R at the beginning of each line, for example,
labels a rewrite rule. And the
$+ expressions mean to match one or more parts of
an address. With experience, such expressions (and indeed the
configuration file as a whole) soon become meaningful.
Fortunately you don’t need to learn the details ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access