38.6 Process-Specified AddressesThe sendmail rule-testing mode has always had the ability to test individual rule sets, but prior to V8.7 sendmail , rule sets could be specified only by number. Beginning with V8.7, rule sets may also be specified by name. Prior to V8 sendmail , rule set 3 was always called first, even if you did not specify it. [3]
38.6.1 Syntax
The
>
Each For numbered rule sets, the number must be in the range of 0 through the highest number allowed. A number that is too large causes sendmail to print the following two errors:
bad ruleset number ( A rule set whose number is below the maximum but that was never defined will act as though it was defined but lacks rules. Named rule sets must exist in the symbol table. If the name specified was never defined, the following error is printed:
Undefined ruleset ident
If any rule set number in the comma-separated
list of rule sets is omitted (e.g.,
Undefined ruleset , identifier
The 38.6.2 The AddressEach address that is specified is processed by sendmail in the same way that mail addresses are processed when actual mail is being sent. Each is parsed and normalized so that everything but the actual address is thrown away. Each is then tokenized and placed into the workspace for rule-set processing. To illustrate, observe the following rule-testing session:
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> >
The first test illustrates that
sendmail
strips RFC822-style
comments from addresses before tokenizing them. This results in the
The second test illustrates that sendmail does not internally recognize addresses in angle brackets. Instead, rule set 3 throws away everything but the address in angle brackets, as shown in the third test. Note that in many actual configuration files, rule set 3 also focuses on the host part of the address. For this reason, you should always begin with rule set 3 unless you are tuning a particular rule for which you know the precise input required. 38.6.3 Rule 3 Always Called First with -btWhen sendmail starts to run in rule-testing mode, its appearance and initial behavior vary from vendor to vendor and from version to version. When rule-testing mode begins, sendmail always prints an introductory banner. Pre-V8 sendmail printed the following banner:
ADDRESS TEST MODE Enter <ruleset> <address> > It is important to note that (unless a banner says otherwise) sendmail always calls rule set 3 first. That is, even if you try to test rule set 0, you always first see the effects of rule set 3. Beginning with V8 sendmail , rule set 3 is no longer automatically called. To ensure that there is no confusion, V8 sendmail prints this banner:
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> >
Note that in all versions the last line (the 38.6.4 The OutputEach line of output that is produced when rule testing begins with an indication of the rule set number being processed:
The word
rewrite: ruleset 3
The word
rewrite: ruleset 3
When rule sets call other rule sets as subroutines,
those calls are shown in the output with
rewrite: ruleset 3 input: Bill Bix < bill > The output can also contain rule set operators:
rewrite: ruleset 0 returns:
In this output,
the operators are printed as they would appear in the configuration
file. The
rewrite: ruleset 0 returns: The correspondence between control characters in the output and sendmail configuration file operators is given in Table 38.2 .
|
|