Name

$_

Synopsis

RFC1413, Identification Protocol, describes a method for identifying the user and host that initiate network connections.[13] It relies on the originating host, which must be running the identd(8) daemon.

When the V8 sendmail daemon receives a network connection request (and if Timeout.ident option, See this section, is nonzero), it attempts to connect to the originating host’s identd service. If the originating host properly supports identification, sendmail reads the login name of the user who initiated the connection (although sendmail will read whatever the other side sends, including garbage). The sendmail program then appends an @ and the originating hostname to what it interprets as the username. If the originating hostname is an IP number in square brackets, sendmail attempts to convert the number to a hostname. The final result, in the form user@host, is assigned to $_.

When sendmail is run on the local machine, it sets $_ to be the name of the user that corresponds to the user-id of the process that ran sendmail. It gets that name by calling getpwuid(3). If the call fails, the name is set to the string:

Unknown UID: num

Here, num is the user-id for which a login name could not be found.

Next, an @ and the name of the local machine are appended to the name, and the result is assigned to $_.

Beginning with V8.7 sendmail, attempts at IP source routing can also be stored in this macro. If sendmail was compiled with IP_SRCROUTE defined, that IP source routing ...

Get Sendmail, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.