DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SMM:08-26
Sendmail Installation and Operation Guide
3.8. Testing Configuration Files
When you build a configuration table, 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. In this mode, you enter lines
of the form:
rwset address
where rwset is the rewriting set you want to use and address is an address to apply the set to. Test
mode shows you the steps it takes as it proceeds, finally showing you the address it ends up with.
You may use a comma separated list of rwsets for sequential application of rules to an input. For
example:
3,1,21,4 monet:bollard
first applies ruleset three to the input "monet:bollard." Ruleset one is then applied to the output of
ruleset three, followed similarly by rulesets twenty-one and four.
If you need more detail, you can also use the "-d21" flag to turn on more debugging. For
example,
sendmail -bt -d21.99
turns on an incredible amount of information; a single word address is probably going to print out
several pages worth of information.
You should be warned that internally, sendmail applies ruleset 3 to all addresses. In test mode
you will have to do that manually. For example, older versions allowed you to use
0 bruce@broadcast.sony.com
This version requires that you use:
3,0 bruce@broadcast.sony.com
As of version 8.7, some other syntaxes are available in test mode:
.D x value
defines macro x to have the indicated value. This is useful when debugging rules
that use the $&x syntax.
.C c value
adds the indicated value to class c.
=S ruleset
dumps the contents of the indicated ruleset.
-d debug-spec
is equivalent to the command-line flag.
Version 8.9 introduced more features:
?
shows a help message.
=M
display the known mailers.
$m
print the value of macro m.
$=c
print the contents of class c.
/mx host
returns the MX records for `host'.
/parse address
parse address, returning the value of crackaddr, and the parsed address.
/try mailer addr
rewrite address into the form it will have when presented to the indicated mailer.
/tryflags flags
set flags used by parsing. The flags can be `H' for Header or `E' for Envelope,
and `S' for Sender or `R' for Recipient. These can be combined, `HR' sets flags
for header recipients.