$x

The full name of the sender All versions

The $x macro holds the full name of the sender. When sendmail processes a mail message for delivery, it rewrites the sender’s address using the canonify rule set 3 and the parse rule set 0 so that it can determine whether the sender is local. If the sender is local, the parse rule set 0 provides the sender’s login name with the $: operator. Then, if the delivery agent’s F=w flag (F=w on page 781) is set,[327] the login name is looked up using the method defined by the MailboxDatabase option (MailboxDatabase on page 1042).[328] If the login name is known, the sender’s full name is returned. If necessary, that full name is then processed, throwing away phone numbers and the like and converting the & character. The result, usually fairly close to the sender’s actual full name, is the value assigned to the $x macro.

Under certain circumstances, sendmail places a different value in $x:

  • When sendmail first starts to run, it sets the full name to be the value of the NAME environment variable, and places that value into $x.

  • The -F command-line switch (-F on page 240) can overwrite the value in the $x macro.

  • If the operating mode is -q (Periodically with -q on page 427) or -bd (-bd on page 234), the value in $x is reset to NULL.

  • In processing the headers of a message, if sendmail finds a Full-Name: header (Full-Name: on page 1158), it assigns the text of that header to the $x macro.

  • In sending a failed mail message, the login name of the sender is taken ...

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.