Mail Administration Guide

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.