9.2 The RHS TripleThe job of rule set 0 is to resolve each address into a triple: the delivery agent's symbolic name, the name of the host, and the name of the user in that order (see Figure 9.2 ). Figure 9.2: Rule set 0 resolves a tripleRecall that rules are like if-then statements. If the rule in the LHS evaluates to true, then sendmail evaluates the RHS:
if true do this R$+ $#hub $@${REMOTE} $:$1 forward to hub otherwise go to next rule This RHS resolves all three parts of the triple. To accomplish this, the text of the RHS is transformed and then copied into the workspace:
$#hub copied as is (delivery agent part) $@${REMOTE} defined macro is expanded (host part) $:$1 positional macro is expanded (user part) We examine these parts in order, showing how each is transformed and copied into the workspace. The transformation operators are shown in Table 9.1 .
9.2.1 The Delivery Agent ($#)
The first part of the triple is the name of the delivery agent.
The RHS
The symbolic name
# Delivery agent definition to forward mail to hub Mhub, P=[IPC], S=0, R=0, F=mDFMuXa, T=DNS/RFC822/SMTP, A=IPC $h
When the RHS is copied into the workspace, any transformation operators
such as
$# the workspace thus far
When text, such as
.:@[] you can change these ()<>,;\"\r\n you cannot change these
Since our symbolic name
$# hub the workspace thus far 9.2.2 The Host ($@)
The second part of the triple is the hostname.
The RHS
D{REMOTE}mailhost # The name of the mail hub
The second part of the triple is now copied to the workspace.
The name of the host is in
$@${REMOTE}
$# hub $@ mailhost the workspace thus far
9.2.3 The User ($:)
The third part of the triple is the username.
The RHS
$:$1
When
sendmail
sees a positional operator, a
$+.$+ $1 $2
then
A
boss @ acme in the original workspace
then the lone All of the original workspace's tokens are then copied. The workspace contains
$# hub $@ mailhost $: boss @ acme After sendmail has completed writing the workspace, the workspace (the triple) is returned. |
|