Problem
I have made changes to my sendmail.cf file, and I want to test them before installing the new configuration. How can I do this?
Cause
When adding new rules to the sendmail.cf file, it is a good idea to see how addresses are filtered through the new rules before allowing the system's sendmail daemon to use the new configuration file.
Solution
Follow these steps:1. When you make changes to the /usr/lib/sendmail.cf file, save it under a different name, for example, "new.cf".
2. Take note of the rule sets that you have modified. Try making
changes to one rule set at a time, testing each change before making
the next.3. After saving the updated cf file to "/usr/lib/new.cf", change to the /usr/lib directory:
# cd /usr/libAnd run sendmail with the -bt option which causes it to run in
address-testing mode. Use the -C option to specify a configuration
file other than sendmail.cf:# ./sendmail -Cnew.cf -btYou will see a > prompt. sendmail is waiting for you to type a
rule set (or rule sets) and address. It will then show you how
the rule sets rewrite the address. For example, you might type:> 3,0 joe@acme.comAnd sendmail might return the following:rewrite: ruleset 3 input: joe @ acme . com
rewrite: ruleset 96 input: joe < @ acme . com >
rewrite: ruleset 96 returns: joe < @ acme . com . >
rewrite: ruleset 3 returns: joe < @ acme . com . >
rewrite: ruleset 0 input: joe < @ acme . com . >
rewrite: ruleset 98 input: joe < @ acme . com . >
rewrite: ruleset 98 returns: joe < @ acme . com . >
rewrite: ruleset 95 input: < > joe < @ acme . com . >
rewrite: ruleset 95 returns: joe < @ acme . com . >
rewrite: ruleset 0 returns: $# smtp $@ acme.com.$:joe<@acme.com.>The final line shows that the mail will be delivered via smtp to the mail exchanger for the domain acme.com with a recipient address of joe@acme.com.
4. To see more detail within each rule set, use the -d21.12 option
when you run sendmail. The -d21.12 debug switch tells sendmail to
print each rule as it is processed. See also
_sendmail_ 2nd Edition, Bryan Costales and Eric Allman, O'Reilly and Associates, 1997, chapters 8-15