SMM:08-40
Sendmail Installation and Operation Guide
local the host part may be omitted
15
. The mailer must be a single word, but the host and user
may be multi-part. If the mailer is the built-in IPC mailer, the host may be a colon-separated list
of hosts that are searched in order for the first working address (exactly like MX records). The
user is later rewritten by the mailer-specific envelope rewriting set and assigned to the $u macro.
As a special case, if the mailer specified has the F=@ flag specified and the first character of the
$:
value is "@", the "@" is stripped off, and a flag is set in the address descriptor that causes
sendmail to not do ruleset 5 processing.
Normally, a rule that matches is retried, that is, the rule loops until it fails. A RHS may
also be preceded by a $@ or a $: to change this behavior. A $@ prefix causes the ruleset to
return with the remainder of the RHS as the value. A $: prefix causes the rule to terminate
immediately, but the ruleset to continue; this can be used to avoid continued application of a
rule. The prefix is stripped before continuing.
The $@ and $: prefixes may precede a $> spec; for example:
R$+ $: $>7
$1
matches anything, passes that to ruleset seven, and continues; the $: is necessary to avoid an
infinite loop.
Substitution occurs in the order described, that is, parameters from the LHS are substi-
tuted, hostnames are canonicalized, "subroutines" are called, and finally $#, $@, and $: are pro-
cessed.
5.1.3. Semantics of rewriting rule sets
There are six rewriting sets that have specific semantics. Five of these are related as
depicted by figure 1.
Ruleset three should turn the address into "canonical form." This form should have the
basic syntax:
addr
3
D
1
S
2
R
4
msg
0
resolved address
Figure 1 -- Rewriting set semantics
D -- sender domain addition
S -- mailer-specific sender rewriting
R -- mailer-specific recipient rewriting
15
You may want to use it for special "per user" extensions. For example, in the address "jgm+foo@CMU.EDU"; the "+foo"
part is not part of the user name, and is passed to the local mailer for local use.