In this chapter and the next, we tie up a few loose ends to install a client.cf file as the system configuration file.
Clearly, you won't want to install the client.cf file as the real sendmail.cf file until you've made sure it works properly. One of the better ways to test a new configuration file is to create a file of addresses for which you already know the correct outcome, then feed the contents of that file to sendmail in rule-testing mode:
/tryflags es /parse user@here /parse email@example.com /parse user@foo /parse foo!user /parse user
Each line begins with a special V8.7 rule-testing command.
The first line causes the tests that follow to parse the address
as an envelope sender (instead of the default envelope recipient).
The way to test the client.cf file using this list looks like this:
mailer hub, host mailhost, user user@here mailer hub, host mailhost, user firstname.lastname@example.org mailer hub, host mailhost, user user@foo mailer hub, host mailhost, user here!user mailer hub, host mailhost, user user
Notice that mail to these addresses will be delivered by using the hub delivery
But why was the lone username in the last line not rewritten
to appear as though it was coming from the hub? Recall that
sender rewriting is done in the
rewrites the lone username first
with rule set 3 (all addresses start with rule set 3), and then
with rule set 1 (all sender addresses pass through rule set 1).
The address is then rewritten by rule set
Further testing would be suggested if the output varied in unexpected ways. It might be necessary to run sendmail in rule-testing mode by hand, testing each rule and sequence of rules individually to find any mistakes in the client.cf file. If the client.cf file tests okay, you are now almost ready to install it as the official sendmail.cf file.