Name

$z

Synopsis

The $z macro holds the location of the local user’s home directory. This macro is given a value only if the delivery agent has the F=w flag set (F=w)[27] and if delivery is to a user (rather than a file or a program). The home directory is looked up using the method defined by the MailboxDatabase option (MailboxDatabase),[28] and that directory’s location is placed into this $z macro.

The sendmail program uses $z to access a user’s ~/.forward file and to save failed mail to a user’s ~/dead-letter file.

$z can be passed in the A= equate to a custom-written local delivery agent. One reason to do so would be to deliver mail to a user’s home directory rather than to a central spool directory. $z is also very useful with the ForwardPath option (ForwardPath).

$z is transient. If it is defined in the configuration file or the command line, that definition will be ignored by sendmail. Note that a $& prefix is necessary when you reference this macro in rules (that is, use $&z, not $z).

[27] Prior to V8.7 this behavior was tied to the local delivery agent.

[28] Prior to V8.12, the getpwnam(3) routine was used.

Get Sendmail, 3rd 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.