Recall that the client.cf file that we have been developing
has two purposes: to forward all mail to a central mail hub for
processing and to make all mail appear as though it originated from
the hub. The first purpose was fulfilled by the creation of a rule set
0 that always selects the
hub delivery agent. In this chapter
we begin the process of fulfilling the second purpose, by designing
rule sets 1 and
But first, to review, recall also that the recipient's address is first
processed by rule set 3 and then by rule set 0.
Rule set 3 finds an address
among other text and cleans up the address by removing nested angle brackets.
After that, rule set
0 selects a delivery agent on the basis of the recipient's address.
If the address is bad, rule set 0 selects the
error delivery agent. For a valid address, rule set 0 selects
hub delivery agent.
Once the delivery agent is selected, the processing of other addresses,
such as the sender's address, may proceed.
When sendmail begins processing a mail message for delivery, it first looks for the envelope  recipients. Each recipient address that is found is first processed by rule set 3, and then by rule set 0, which selects a delivery agent.
 See Chapter 1, Introduction, for a review of the concepts of header versus envelope.
After appropriate delivery agents have been selected for all recipients, sendmail
processes the sender's address. There is usually only a single sender
for any given mail message. The sender's address (or addresses)
may appear in the envelope or in a
From: header line, or it may
be derived from the uid of the process that ran sendmail.
 The envelope sender and the header sender are not necessarily the same.
As shown in
the address is processed by rule set 3 first and then by
rule set 1. Then, for each recipient in the list of recipients,
each sender's address is custom processed by the rule set
specified in the recipient delivery agent's
This custom processing is necessary because different delivery
agents may want the sender's address to have a different appearance.
One example is the difference between a domain-based delivery
agent (needing an address such as email@example.com) and
a UUCP-based delivery agent (needing a routing path such as
We will examine the custom
S= processing first, then
discuss why a generic rule set 1 is not needed in the client.cf file.