How to calculate sendmail throughput

emailloggingsendmail

Does anyone have a script that can output the number of mails sent in the last hour, i.e. sendmail outgoing throughput. It should be possible to determine by analysing the mail log (/var/log/maillog)?

Perhaps there is some FOSS to help?

Using mailstats (/usr/sbin/mailstats) doesn't seem to be much use as it only gives stats from when the mail server was first turned on, not in the last hour. Perhaps I'm wrong?

Best Answer

You're wrong about mailstats I think. If you use the "-p" flag it will reset the stats so you can run it hourly from cron like this:

/usr/sbin/mailstats -p

...and start fresh stats for the next hour. Hope that helps.