Does anyone know of a utility of that would give me the total number of email messages sent by sendmail, using old maillogs ?
Someone suggested the use of the mailstats utility, however this program seems to give the statistical information for all mail log file entries. Though this is beneficial, it's not helpful on this case since a single mail message sent by sendmail can log anywhere to 5 different log entries.
Does
grep 'Message accepted for delivery' /var/log/maillog| wc -l
provide the number you need?You can use
grep -c
to count the number of matching lines instead of pipegrep
towc -l
: