hoststat (V8.8 and Later)
The hoststat command is a synonym
for the -bh
command-line switch. It causes
sendmail to print its
persistent host status and exit. Persistent host
status is enabled with the HostStatusDirectory
option (HostStatusDirectory on page
1037).
The output produced by this command begins with a heading such as this:
-------------- Hostname --------------- How long ago ---------Results---------
Then, for each host whose status it has saved, sendmail prints this information:
Hostname
This is the name of the host that was connected to. It might not be the hostname specified for the recipient. It could easily be an MX record instead. If a message has multiple recipients, a separate status line will be produced for each unique host that is tried. If this name is prefixed with an asterisk, the status file is locked and currently being updated.
How long ago
This shows how long ago this status record was updated. It is printed in the form:
DD+HH:MM:SS
Here,
DD
is the number of days. If the status were updated less than one day ago, theDD+
is omitted. TheHH
is hours, theMM
is minutes, and theSS
is seconds. The colons are literal.Results
This shows the result of the last connection attempt, failure, or success. If no reason was stored, this prints as:
No status available
If a result was stored, it will print in two parts:
smtp msg
The
smtp
is the SMTP reply code. Themsg
is the text of the message generated by the other end or other program.
To illustrate, consider this output:
-------------- ...
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.