Rule Operator Reference

In this section we describe each rule operator. Note that we exclude operators that are not germane to rules (such as $?, Section 21.6), and list 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).

To avoid confusion based on different ways of pronouncing symbols, we list all the operators in Table 18-3 so that you can easily find them.

Table 18-3. Operators in rules

Operator

§

RHS or LHS

Description or use

$&

$&

LHS and RHS

Delay macro expansion until runtime

$@

$@

LHS

Match exactly zero tokens (V8 only)

$@

$@

RHS

Rewrite once and return

$@

$@

RHS

Specify host in delivery-agent “triple”

$@

$@

RHS

Specify DSN status in error-agent “triple”

$@

$@

RHS

Specify a database-map argument

$:

$:

RHS

Rewrite once and continue

$:

$:

RHS

Specify address in delivery-agent “triple”

$:

$:

RHS

Specify message in error- or discard-agent “triple”

$:

$:

RHS

Specify a default database-map value

$digit

$digit

RHS

Copy by position

$=

$=

LHS

Match any token in a class

$>

$>

RHS

Rewrite through another rule set (subroutine call)

$[ $]

$[ $]

RHS

Canonicalize hostname

$( $)

$( $)

RHS

Perform a database-map lookup or action

$-

$-

LHS

Match exactly one token

$+

$+

LHS

Match one or more ...

Get Sendmail, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.