10.2 Rule Set 3In its initial form, rule set 3 looks like this:
S3 # preprocessing for all rule sets R$* < $* > $* $2 basic RFC822 parsing
As with rule set 0, the definition of rule set 3
begins with the The only rule in rule set 3 is composed of three parts, each separated from the others by one or more tab characters:
R$* < $* > $* $2 basic RFC822 parsing Note that we will now separate the tokens in the LHS with spaces (not tabs) to make the LHS easier to understand. Spaces always separate tokens, yet are never themselves tokens. 10.2.1 The LHS
The wildcard operator in this LHS, the
$+ @ $+ This LHS easily matches an address like you@here.us.edu in the workspace:
workspace LHS you $+ This same LHS, however, does not match an address like @here.us.edu :
workspace LHS @ $+
Because the
The
workspace LHS $* The LHS in rule set 3 matches anything or nothing, provided that there is a pair of angle brackets in the workspace somewhere:
R$* < $* > $* $2 basic RFC822 parsing For example, consider an address that might be given to sendmail by your MUA:
Your Fullname <you@here.us.edu> This address is tokenized and placed into the workspace. That workspace is then compared to the LHS:
workspace LHS Your $*
10.2.2 The RHS
Recall that the objective of rule set 3 is to strip everything
but the address part (the text between the angle brackets).
That stripping is accomplished by rewriting the workspace using the
R$* < $* > $* $2 basic RFC822 parsing
Remember, when a $
$* < $* > $*
workspace LHS RHS Your $*
This illustrates that the middle (second) 10.2.3 Test Rule Set 3Take a few moments to experiment. Observe the transformation of a user-specified address into one that sendmail can use. Add the following new rule set 3 to the rule sets in the client.cf file:
Now run
sendmail
again. Up to now, you have been testing rule set 0,
so you have specified a 0 following the
% As expected, the new rule causes everything except the "good" email address, the address between the angle brackets, to be thrown away.
Before we improve rule set 3,
take a few moments to experiment. Experiment by putting
the
As a closing note, recall that
sendmail
does the minimum matching possible when
comparing operators to the workspace. Although
Expecting operators to match more than they do can cause you to misunderstand the effect of rules. |
|