$y
Name of the controlling TTY All versions
The $y
macro holds
the name of the controlling terminal device, if
there is one. The controlling terminal is determined
by first calling ttyname(3)
with the sendmail program’s
standard error output as an argument. If
ttyname(3) returns the name
of a terminal device (such as /dev/ttypa
),
sendmail strips everything up
to and including the last /
character and stores the result into
$y
.
$y
is intended for
use in debugging sendmail
problems. It is not used internally by
sendmail. In determining
whether it can write to a user’s terminal screen,
sendmail calls
ttyname(3) separately on its
standard input, output, and error output without
updating $y
.
Note that the device name in $y
depends on the implementation of
ttyname(3). Under BSD Unix,
all terminals are in /dev,
whereas under other versions of Unix they can be in
subdirectories such as
/dev/ttys. Also note that
$y
is defined
only if TTYNAME is defined (TTYNAME on page 148) when sendmail
is compiled.
$y
is transient. If
it is defined in the configuration file or the
command line, that definition will be ignored by
sendmail. Finally, note that
$y
is set only
when mail is being sent and, therefore, is of most
value in headers.
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.