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.
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.
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:
Beware of doing too much to the name in this rule set, as anything you do will be reflected in the message.
Do not strip local domains in this rule set. Doing so can leave you with names that have no domain specifications at all. sendmail appends the sending domain to names with no domain, which can change the semantics of names.
Do not provide fully qualified domains in this rule set. Although technically correct, fully qualified domain names can lead to unnecessarily long names reflected in messages. The SunOS configuration files define rule set 9 to qualify domain names and strip local domains. Rule set 9 is called from rule set 0 to get all names into a cleaner form.
After you have rule set 3 finished, the other rule sets should be relatively simple. Examine the supplied configuration files for hints.
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.