Useful Sendmail Commands

Posted on 8:30 PM by Bharathvn

Useful Commands
The following are some commands that will help you administer a sendmail server:

hoststat — Shows the status of the hosts that worked with the local mail server recently. The command is an equivalent of the sendmail -bh command, which is inactive by default.

mailq — Displays short information about messages waiting in the queue to be processed. The following is an example of the command's execution results:

/var/spool/mqueue (1 request)
----Q-ID---- --Size-- ----- Q-Time----- -----Sender/Recipient -----
jOIAnSTl1838 6 Tue Jan 18 13:49
(host map: lookup (flenovm.ru): deferred)


The first line tells you that there is one message in the queue. The second line (that is, the first line below the header) displays the date the message was sent (Tue Jan 18 13:49) and the sender's address (flenov@flenovm.ru). The last line shows the message's recipient:root@flenovm.ru.

mailstats — Displays message statistics, including the total number of bytes sent.

sendmail — This is the sendmail server command. When run with different options, it can provide various types of useful information. Consult its man page for more information.