$@

Rewrite once and return RHS prefix

The $@ operator, when used to prefix the RHS, tells sendmail that the current rule is the last one that should be used in the current rule set. If the LHS of the current rule matches, any rules that follow (in the current rule set) are ignored.

This $@ prefix also prevents the current rule from calling itself recursively. To illustrate, consider the following rule:

 R $* . $* $@ $1

The idea here is to strip the domain part of a hostname, and to return just the host part. That is, if the workspace contains wash.dc.gov, this rule will return wash. The $@ prefix to the RHS tells sendmail to return the rewritten workspace without processing any additional rules in the current rule set, and to allow the LHS to match only once.

Note that the $@ prefix can prefix only the RHS. This operator is described further in Rewrite-and-Return Prefix: $@ on page 664 of this chapter.

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.