There are three useful tables in this chapter:
Table 18-2 lists all the rule operators that you may use on the LHS of rule sets (Section 18.2.1 [V8.13])
Table 18-3 lists all the rule operators that you may use on the RHS of rule sets (Section 18.2.2 [V8.13])
Table 18-4 lists all the rule operators (Section 18.2.3 [V8.13])
The LHS (lefthand side) of any rule is compared to the current contents of the workspace to determine whether the two match. Table 18-2 displays a variety of special operators offered by sendmail that make comparisons easier and more versatile.
Table 18-2. LHS operators
Operator |
sendmail text reference |
Description or use |
---|---|---|
|
18.9.21[3ed] |
Match zero or more tokens |
|
18.9.17[3ed] |
Match one or more tokens |
|
18.9.16[3ed] |
Match exactly one token |
|
18.9.2[3ed] |
Match exactly zero tokens (V8 only) |
|
22.2.1[3ed] |
Match any tokens in a class[a] |
|
22.2.2[3ed] |
Match any single token not in a class |
|
18.9.18[3ed] |
Match a literal |
|
18.9.23[3ed] |
Match a literal |
|
21.5.3[3ed] |
Delay macro expansion until runtime |
[a] Class matches either a single token or multiple tokens, depending on the version of sendmail (§22.2[3ed]). |
The RHS (right-hand side) of a rule
rewrites the workspace. To make this
rewriting more versatile, sendmail
offers
several special RHS operators. The complete list is shown in Table 18-3.
Table 18-3. RHS operators
RHS |
sendmail text reference |
Description or use |
---|---|---|
|
18.7.1[3ed] |
Copy by position. |
|
18.7.2[3ed] |
Rewrite once (when used as a prefix), or specify the address in a delivery-agent “triple,” or specify the default value to return on a failed database-map lookup. |
|
18.7.3[3ed] |
Rewrite and return (when used as a prefix), or specify the host in a delivery-agent “triple,” or specify an argument to pass in a database-map lookup or action. |
|
18.7.4[3ed] |
Rewrite through another rule set (such as a subroutine call that returns to the current position). |
|
18.7.5[3ed] |
Specify a delivery agent or choose an action, such as reject or discard a recipient, sender, connection, or message. |
|
18.7.6[3ed] |
Canonicalize hostname. |
|
23.4[3ed] |
Perform a lookup in an external database, file, or network service, or perform a change (such as dequoting), or store a value into a macro. |
|
21.5.3[3ed] |
Delay conversion of a macro until runtime. |
In this section, we list each
rule operator. Note that we exclude
operators that are not germane to rules (such as
$?
, 21.6[3ed]) and list (in Table 18-4) only those that can be used in rules. Because
all rule operators are symbolic, we cannot list them in alphabetical
order, so instead, we list them in the alphabetical order of
pronunciation. That is, for example, $@
(pronounced dollar-at) comes before $
: (pronounced
dollar-colon).
Table 18-4. Operators in rules
Operator |
sendmail text reference |
RHS or LHS |
Description or use |
---|---|---|---|
|
18.9.1[3ed] |
LHS and RHS |
Delay macro expansion until runtime |
|
18.9.2[3ed] |
LHS |
Match exactly zero tokens (V8 only) |
|
18.9.3[3ed] |
RHS |
Rewrite once and return |
|
18.9.4[3ed] |
RHS |
Specify host in delivery-agent “triple” |
|
18.9.5[3ed] |
RHS |
Specify DSN status in error-agent “triple” |
|
18.9.6[3ed] |
RHS |
Specify a database-map argument |
|
18.9.7[3ed] |
RHS |
Rewrite once and continue |
|
18.9.8[3ed] |
RHS |
Specify address in delivery-agent “triple” |
|
18.9.9[3ed] |
RHS |
Specify message in error- or discard-agent “triple” |
|
18.9.10[3ed] |
RHS |
Specify a default database-map value |
|
18.9.11[3ed] |
RHS |
Copy by position |
|
18.9.12[3ed] |
LHS |
Match any token in a class |
|
18.9.13[3ed] |
RHS |
Rewrite through another rule set (subroutine call) |
|
18.9.14[3ed] |
RHS |
Canonicalize hostname |
|
18.9.15[3ed] |
RHS |
Perform a database-map lookup or action |
|
18.9.16[3ed] |
LHS |
Match exactly one token |
|
18.9.17[3ed] |
LHS |
Match one or more tokens |
|
18.9.18[3ed] |
LHS |
Match a literal |
|
18.9.19[3ed] |
RHS |
Specify a delivery agent |
|
18.9.20[3ed] |
RHS |
Specify return for a policy-checking rule set |
|
18.9.21[3ed] |
LHS |
Match zero or more tokens |
|
18.9.22[3ed] |
LHS |
Match any single token not in a specified class |
|
18.9.23[3ed] |
LHS and RHS |
Match or return a literal |
18.220.81.106