The RHS

The purpose of the RHS in a rule is to rewrite 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

§

Description or use

$digit

Copy by Position: $digit on page 661

Copy by position.

$:

Rewrite Once Prefix: $: on page 662

Rewrite once (when used as a prefix), or specify the user in a delivery agent “triple,” or specify the default value to return on a failed database-map lookup.

$@

Rewrite-and-Return Prefix: $@ on page 664

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.

$>set

Rewrite Through a Rule Set: $>set on page 664

Rewrite through another rule set (such as a subroutine call that returns to the current position).

$#

Return a Selection: $# on page 667

Specify a delivery agent or choose an action, such as to reject or discard a recipient, sender, connection, or message.

$[ $]

Canonicalize Hostname: $[ and $] on page 668

Canonicalize the hostname.

$( $)

Use $( and $) in Rules on page 892

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.

$&

Use Value As Is with $& on page 793

Delay conversion of a macro until runtime.

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.