Testing How Addresses Are Rewritten:
To test the new configuration, run sendmail with the -bt
option. sendmail displays a welcome
message, and waits for you to enter a test. A simple test is a list of ruleset names followed by an
e-mail address. For example, entering canonify,parse craig at the prompt would process the
e-mail address craig through the rulesets canonify and then parse. This should provide you with the
mailer, host, user delivery triple for the address.
Because you know the mailer that you want to test, you can use the /try
command at the prompt to
process the sender From address for the smtp mailer. The example in the following listing illustrates the test.
First, test the existing configuration to see how the address is processed by the default
configuration.
# sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> /tryflags HS
> /try smtp craig
Trying header sender address craig for mailer esmtp
canonify |
input: |
craig |
|
Canonify2 |
input: |
craig |
|
Canonify2 |
returns: |
craig |
|
canonify |
returns: |
craig |
|
1 |
input: |
craig |
|
1 |
returns: |
craig |
|
HdrFromSMTP |
input: |
craig |
|
PseudoToReal |
input: |
craig |
|
PseudoToReal |
returns: |
craig |
|
MasqSMTP |
input: |
craig |
|
MasqSMTP |
returns: |
craig |
< @ *LOCAL* > |
MasqHdr |
input: |
craig |
< @ *LOCAL* > |
MasqHdr |
returns: |
craig |
< @ parrot . foobirds . org . > |
HdrFromSMTP |
returns: |
craig |
< @ parrot . foobirds . org . > |
final |
input: |
craig |
< @ parrot . foobirds . org . > |
final |
returns: |
craig |
@ parrot . foobirds . org |
Rcode = 0, addr = craig@parrot.foobirds.org
> /quit
Run sendmail –bt
, which starts sendmail in test mode with the default configuration. the previous listing
shows exactly how the standard configuration processes e-mail addresses. Specifically, it shows
how local sender addresses are rewritten for outbound mail.
The /tryflags command defines the type of address to be processed. Four flags are available: S for sender, R for recipient, H for header, and E for envelope. By combining two of these flags, the /tryflags command tells sendmail to process a header sender (HS) address.
The /try command tells sendmail to process the e-mail address craig through the mailer esmtp. The address returned by ruleset final, which is always the last ruleset to process an address, shows the address used on outbound mail after all of the rulesets have processed the address. With the default configuration, the input address craig is converted to craig@parrot.foobirds.org.