Next: Mixing and Matching Binary Up: Administrivia and Stupid Mail Previous: Running the Sendmail Queue

## Reporting Mail Statistics

Many site administrators (and the persons they work for) are interested in the volume of mail passing to, from, and through the local site. There are a number of ways to quantify mail traffic.

- Sendmail comes with a utility called mailstats that reads a file called /usr/local/lib/mail/sendmail.st and reports the number of messages and number of bytes transferred by each of the mailers used in the sendmail.cf file. This file must be created by the local administrator manually for sendmail logging to occur. The running totals are cleared by removing and recreating the sendmail.st file. One way is to do the following:

- Probably the best way to do quality reporting regarding who uses mail and how much volume passes to, from, and through the local system is to turn on mail debugging with syslogd(8). Generally, this means running the /etc/syslogd daemon from your system startup file (which you should be doing anyway), and adding a line to /etc/syslog.conf(5) that looks something like the following:

  If you use mail.debug and get any medium to high mail volume, the syslog output can get quite large. Output files from syslogd generally need to be rotated or purged on a routine basis from crond(8).

  There are a number of commonly available utilities that can summarize the output of mail logging from syslogd. One of the more well known utilities is syslog-stat.pl, a perl script that is distributed with the sendmail+IDA sources.