$f

The sender’s address All versions

The $f macro is used to hold the address of the sender. That address can be obtained by sendmail from any of a variety of places:

  • During an SMTP conversation the sending host specifies the address of the sender by issuing a MAIL From: command.

  • Users and programs can specify the address of the sender by using the -f command-line switch when running sendmail.

  • In processing a message from the queue, the sender’s address is taken from the qf file’s S line.

  • In processing bounced mail, the sender becomes the name specified by the value of $n, usually mailer-daemon.

  • In the absence of the preceding factors, sendmail tries to use the user identity of the invoking program to determine the sender.

Once sendmail has determined the sender (and performed aliasing for a local sender), it rewrites the address found with the canonify rule set 3, the rule set 1, and the final rule set 4. The rewritten address is then made the value of $f.

$f is intended for use in both configuration-file header commands and delivery agent A= equates. $f differs from $g in that $g undergoes additional processing to produce a true return address. When sendmail queues a mail message and when it processes the queue, the values in $f and $g are identical.

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

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.