Sendmail Installation and Operation Guide
SMM:08-19
.hoststat
7
. Removing this directory and its subdirectories has an effect similar to the purgestat
command and is completely safe. However, purgestat only removes expired (Timeout.hoststatus)
data. The information in these directories can be perused with the hoststat command, which will
indicate the host name, the last access, and the status of that access. An asterisk in the left most col-
umn indicates that a sendmail process currently has the host locked for mail delivery.
The disk based connection information is treated the same way as memory based connection
information for the purpose of timeouts. By default, information about host failures is valid for 30
minutes. This can be adjusted with the Timeout.hoststatus option.
The connection information stored on disk may be expired at any time with the purgestat
command or by invoking sendmail with the -bH switch. The connection information may be
viewed with the hoststat command or by invoking sendmail with the -bh switch.
2.5. The Service Switch
The implementation of certain system services such as host and user name lookup is con-
trolled by the service switch. If the host operating system supports such a switch, and sendmail
knows about it, sendmail will use the native version. Ultrix, Solaris, and DEC OSF/1 are examples
of such systems
8
.
If the underlying operating system does not support a service switch (e.g., SunOS 4.X, HP-
UX, BSD) then sendmail will provide a stub implementation. The ServiceSwitchFile option points
to the name of a file that has the service definitions. Each line has the name of a service and the
possible implementations of that service. For example, the file:
hosts dns files
nis
aliases files nis
will ask sendmail to look for hosts in the Domain Name System first. If the requested host name is
not found, it tries local files, and if that fails it tries NIS. Similarly, when looking for aliases it will
try the local files first followed by NIS.
Notice: since sendmail must access MX records for correct operation, it will use DNS if it is
configured in the ServiceSwitchFile file. Hence an entry like
hosts files dns
will not avoid DNS lookups even if a host can be found in /etc/hosts.
Service switches are not completely integrated. For example, despite the fact that the host
entry listed in the above example specifies to look in NIS, on SunOS this won't happen because the
system implementation of gethostbyname (3) doesn't understand this.
2.6. The Alias Database
After recipient addresses are read from the SMTP connection or command line they are
parsed by ruleset 0, which must resolve to a {mailer, host, address} triple. If the flags selected by
the mailer include the A (aliasable) flag, the address part of the triple is looked up as the key (i.e.,
the left hand side) into the alias database. If there is a match, the address is deleted from the send
queue and all addresses on the right hand side of the alias are added in place of the alias that was
found. This is a recursive operation, so aliases found in the right hand side of the alias are similarly
expanded.
The alias database exists in two forms. One is a text form, maintained in the file
/etc/mail/aliases. The aliases are of the form
7
This is the usual value of the HostStatusDirectory option; it can, of course, go anywhere you like in your filesystem.
8
HP-UX 10 has service switch support, but since the APIs are apparently not available in the libraries sendmail does not use the
native service switch in this release.