29.3 The Sequence of Rule SetsWhen sendmail rewrites addresses, it applies its rule sets in a specific sequence. The sequence differs for sender and recipient addresses, with a third branch used to select delivery agents. Figure 29.1 shows a map of the different paths taken by each kind of address. Those paths show how addresses flow through rule sets.
Both sender and recipient addresses are first input into rule set 3.
Then each
takes a different path through the rule sets based on its type.
Recipient addresses take the dashed path, whereas sender addresses
take the solid path. But before those paths can be taken,
sendmail
needs to select a delivery
agent (the dotted path)
to get rule-set numbers for the
Figure 29.1: The flow of rules through rule sets
To select a delivery agent,
sendmail
rewrites the recipient address with rule sets 3 and
0 (the dotted path).
Rule set 0 selects a delivery agent that is appropriate for the recipient.
That delivery agent supplies rule set values for the
After a delivery agent has been selected,
the sender address is processed
(see
Figure 29.2
).
As was mentioned above, it is first input
into rule set 3. Then it flows through rule set 1, then the Figure 29.2: The flow of sender addresses through rule setsNote that all addresses are eventually rewritten by rule set 4. In general, rule set 4 undoes any special rewriting that rule set 3 did.
Finally, the recipient address also needs to be rewritten for inclusion in
the header and envelope of mail messages
(see
Figure 29.3
).
Recall that it was already used once to select the delivery agent.
It is used as input to rule set
3, as are all addresses. It then flows through rule set 2, then through
the Figure 29.3: The flow of recipient addresses through rule sets
The need for separate paths for the sender and the recipient is best explained with an example. Consider a site that wants the addresses of all local users to appear as though they are from the local domain. Such rewriting is appropriate for local users on outgoing mail but inappropriate for recipients at other sites. Clearly, such rewriting should be restricted to the sender path, probably in rule set 1. The flow of rules through rule sets (as is shown in Figure 29.3 ) is appropriate for all versions of sendmail . Some versions, such as V8, enhance these rules with others, but all those enhancements begin with this basic set. 29.3.1 V8 Enhancements
V8
sendmail
allows envelope addresses to be rewritten separately
from header addresses. This separation takes place in the delivery
agent Figure 29.4: V8 splits rewriting: envelope (solid) versus header (dashed)The method that is used to split rewriting looks like this:
R=
The envelope-specific rule set is the one to the left of the slash and is
represented by a solid line. The
header-specific rule set is to the right of the slash ( |
|