38.8 Batch Rule-Set TestingThe 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:
%
Here, the
3,0 nobody@ourhost 3,0 nobody@ourhost.domain 3,0 nobody@distant.domain ... 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 nobody@outhost 3 input: nobody @ outhost 0 returns: $# local $: nobody > 3,0 nobody@ourhost.domain 3 input: nobody @ ourhost . domain 0 returns: $# local $: nobody > 3,0 nobody@distant.domain 3 input: nobody @ distant . domain 0 returns: $# smtp $@ distant . domain $: nobody < @ distant . domain >
Note that the
Also note that directly calling rule sets 3 and 0 produces less useful information
than does the |
|