On VPS2 or a dedicated mail server, you can display the server's sendmail statistics by typing the command "mailstats", without parameters.
On a VPS1, however, you must do the following:
% cp /usr/sbin/mailstats ~/usr/sbin/mailstats
% virtual /usr/sbin/mailstats -C /etc/sendmail.cf
You should see something like the following
Statistics from Mon Jun 25 14:32:41 2001 M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis Mailer 0 0 0K 6491 21036K 0 0 prog 1 0 0K 1 4K 0 0 *file* 3 13925 132391K 2795 3607K 158 0 local 4 1 1K 0 0K 0 0 smtp 5 7944 131541K 101787 834030K 719 0 esmtp 8 0 0K 4 4K 0 0 relay 9 7730 283951K 10446 409609K 27 0 procmail ============================================================= T 29600 547884K 121524 1268290K 904 0 C 29600 121524 1133
The above output is tallied from information in the sendmail "statistics" file. On the VPS1, the statistics file is named ~/etc/sendmail.st.
Unless you have "cleared" the statistics file, it will show statistics from the time you first provisioned your account until now. The statistics will probably be more informative if you clear the file periodically--every day, week or month, for example. You can clear the file by issuing
% cp /dev/null ~/etc/sendmail.st
or any command to remove or rename the file. If the file is not present, sendmail will not create a new one, so if you delete or rename the file, you need to create a new (empty) one with the command
% touch ~/etc/sendmail.st
(The following is from the mailstats man page.)
M | The mailer number. |
---|---|
msgsfr | Number of messages from the mailer. |
bytes_from | Kbytes from the mailer. |
msgsto | Number of messages to the mailer. |
bytes_to | Kbytes to the mailer. |
msgsrej | Number of messages rejected. |
msgsdis | Number of messages discarded. |
Mailer | The name of the mailer. |
Here are some of the Mailers (also called Delivery Agents or Mail Delivery Agents) you might see mentioned in the right column of mailstats output. (Mailers appear in the sendmail.cf file on lines that begin with an uppercase "M".)