The output that is produced by sendmail can become huge, especially when many addresses need testing. To simplify the process (and to help bulletproof your configuration file), consider using a shell script like the following:
#!/bin/sh /usr/lib/sendmail -bt < $1 |\ egrep " 3.*input:| 0.*returns|^>" |\ sed -e 's/^rewrite: ruleset //'
Here, the output is piped through a egrep(1) selects only the lines of interest. If this script were to be called testcf.sh, it could be invoked with the following command line:
address.list is a file consisting of pairs of rule-set
numbers and addresses like the following:
3,0 [email protected] 3,0 [email protected] 3,0 [email protected] ... and so on
The output that is produced shows the input to rule set 3 and the delivery agent returned by each call to rule set 0:
> 3,0 [email protected] 3 input: nobody @ outhost 0 returns: $# local $: nobody > 3,0 n[email protected] 3 input: nobody @ ourhost . domain 0 returns: $# local $: nobody > 3,0 [email protected] 3 input: nobody @ distant . domain 0 returns: $# smtp [email protected] distant . domain $: nobody < @ distant . domain >
Note that the
address.list file should contain every conceivable kind of
address. The output from the
shell script should be saved. At a later time, after
the configuration file is changed, diff(1) can be
used to see if the saved output differs from the new output
(to see whether anything unexpected changed as a result of your
Also note that directly calling rule sets 3 and 0 produces less useful information
than does the
/parse rule-testing command (see Section 38.5.5).
If you use that command, a diff(1) against prior output may
provide more interesting and complete information.