Delivering to Local Recipient
Typically, some early rules in the parse
rule set 0 are
intended to detect addresses that should be
delivered locally. A rule that accomplishes that end
might look like this:
R $+ <@ $w> $#local $:$1 local address
Here, the $w
sendmail macro is the name of
the local host. Note that the RHS strips the focused
host part from the username.
At some sites, the local host can be known by any of
several names. A rule to handle such hosts would
begin with a class declaration that adds those names
to the class w
(such as in the first line here):
Cw font-server fax printer3 R $+ <@ $=w> $#local $:$1 local address
The class w
is
special because it is the one to which
sendmail automatically
appends the alternative name of the local host. This
class declaration line adds names that
sendmail might not
automatically detect. Usually, such a declaration
would be near the top of the configuration file
rather than in the parse
rule set 0, but technically it
can appear anywhere in the file. This rule looks to
see whether an address contains any of the names in
class w
. If it
does, the $=w
in
the lefthand side (LHS) matches, and the RHS selects
the local
delivery agent.
On central mail-server machines, the parse
rule set 0 might
also have to match from a list of hosts for which
the central server is an MX recipient machine (FEATURE(use_cw_file) on page 643).
Get sendmail, 4th 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.