$&

Delay macro expansion until runtime LHS and RHS operator

Normally, sendmail macros are expanded (replaced with their values) when the configuration file is read. For those situations when a sendmail macro should not be expanded, but rather should be used in rules as is, V8 sendmail offers the $& prefix. For example, consider the following RHS of a rule:

 R...  $w.$&M

Normally, when sendmail encounters this RHS in the configuration file, it will recursively expand $w into its final text value (where that text value is your hostname, such as wash.dc.gov). But because the M sendmail macro is prefixed (here, with $&), it is not expanded until the rule is processed.

The $& operator can be used in either the LHS or the RHS of a rule. The $& operator is described in full in Use Value As Is with $& on page 793.

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.