Mail Administration Guide

Building a Configuration File

Building a configuration file "from scratch" is a complex task. Fortunately, it is almost never necessary; you can accommodate almost every situation by changing an existing file. In any case, it is critical that you understand what you are trying to do and come up with a policy statement for the delivery of mail. This section explains the purpose of a configuration file and gives you some ideas about policies.

Domains and Policies

RFC 1006 describes domain-based naming. RFC 822 touches on this issue as well. Essentially, each host is given a name that is a right-to-left dot-qualified pseudo-path from a distinguished root. The elements of the path are organizational entities, not physical networks.

RFC 822 and RFC 976 specify how to parse certain sorts of addresses. You can configure sendmail to follow or ignore these rules.

How to Proceed

After you have established a policy, examine the available configuration files to decide if you can use major parts of any of them. Even under the worst of conditions, there is a fair amount of boilerplate information that can be collected safely.

The next step is to build rule set 3, which specifies a rule set for your individual mailers. Building rule set 3 is the hardest part of the job. Here are some guidelines:

After you have rule set 3 finished, the other rule sets should be relatively simple. Examine the supplied configuration files for hints.

Testing the Rewriting Rules-the -bt Flag

When you build a configuration file, you can do a certain amount of testing using the test mode of sendmail. For example, you could invoke sendmail as:


% sendmail -bt -Ctest.cf

which would read the configuration file test.cf and enter test mode. For example:


ADDRESS TEST MODE
Enter <ruleset> <name>
>

In this mode, you enter lines in this form:


ADDRESS TEST MODE
Enter <ruleset> <name>
> rwset  name

where rwset is the rewriting set you want to use and name is a name to which to apply the set. Test mode shows you the steps it takes as it proceeds and shows you the final name. You can use a comma-separated list of rwsets for sequential application of rules to an input. For example:


ADDRESS TEST MODE
Enter <ruleset> <name>
> 3,1,21,4 jupiter:smith

First apply rule set 3 to the input monet:bollard. Rule set 1 is then applied to the output of rule set 3, followed similarly by rule sets 21 and 24.

If you need more detail, you can also use the d21 flag to turn on more debugging. For example, the command:


% sendmail -bt -d21.99

turns on a large amount of information; a single-word name might result in several pages worth of information.