10.5 Details of Rule Flow
To better see what is happening inside each rule,
rerun
sendmail
with a
%
The
>
This output may appear complicated, but it is really fairly straightforward.
The first two lines and last line are what you have been seeing
all along (when you
didn't
use the
>
Everything in between those lines is new output caused by the
R$* <> $* $n handle <> error address
The workspace (tokenized from the input of
---trying rule: $* < > $* --- rule fails The LHS doesn't match (the rule fails) because the angle brackets of the workspace are not empty. Consequently, the RHS of the first rule is not called, and the workspace is unchanged. The second rule is the de-nesting one:
R$* < $* < $* > $* > $* $2<$3>$4 de-nest brackets
The workspace (still
---trying rule: $* < $* < $* > $* > $* The LHS matches the workspace, so the workspace is rewritten on the basis of the RHS of that rule, and the extra angle brackets are stripped away:
---rule matches: $2 < $3 > $4 rewritten as: a < b > c The new workspace is then compared to the LHS of the same rule once again - that is, to the rule that just did the rewriting. If it were to match again, it would be rewritten again. This property (which in error can continue forever) can be useful in solving many configuration problems. We'll cover this property more fully in the next chapter. So the rewritten workspace is compared once again to the second rule. The workspace (having been rewritten by the second rule) now contains
a < b > c This time the comparison fails:
---trying rule: $* < $* < $* > $* > $* --- rule fails The last of the three rules then gets a crack at the workspace. That rule is
R$* < $* > $* $2 basic RFC822 parsing That workspace is still
a < b > c The workspace is once again matched, so it is rewritten again on the basis of the RHS of the third rule:
---trying rule: $* < $* > $* ---rule matches: $2 rewritten as: b After the third rule rewrites the workspace, it again tries to match that rewritten workspace and fails:
---trying rule: $* < $* > $* --- rule fails
As you can see, the |
|