"David W. Tamkin" <dattier(_at_)Mcs(_dot_)Net> writes:
Jeff Grossman asked,
| What is the mailstat program? What does it do?
Mailstat is a shell-and-awk script for summarizing the entries in your
procmail logfile. It's described in the distribution documentation, but not,
as far as I know, in the manual pages, so if you're a user on a site where an
administrator has installed procmail, it's understandable that you might not
know of it.
For an example of the result, here's the result of running mailstat on
one of my recent logfiles (I rotate them weekly):
lunen% mailstat -k 1999_06_06
Total Number Folder
----- ------ ------
1577354 408 /var/mail/guenther
62935 16 Lists/SmartList/.
13766 5 Lists/amanda/.
186866 50 Lists/bugtraq/.
330175 122 Lists/cvs/.
152438 38 Lists/ietf/.
44939 16 Lists/ntbugtraq/.
68866 33 Lists/ntdom/.
18163 7 Lists/pdev/.
227744 77 Lists/procmail/.
2257 1 Lists/rdist/.
21874 10 Lists/technotes/.
----- ------
2707377 794
lunen%
Mailstat expects the name of a logfile on the command line. By
default, mailstat renames that logfile, adding ".old" to the end, and
creates a new empty logfile under the original name. If the logfile is
empty, it isn't rotated and mailstat prints the message:
No mail arrived since <date>
Lines in the logfile which don't look like normal delivery abstracts
(generally error messages and items logged via assignment to the LOG
variable) are included in the output prefixed with two hashes. For
example:
0 1 ## Converted quoted-printable mail from: "Mark F. Vlems"
<mvlems(_at_)vbox(_dot_)xs4all(_dot_)nl>
The -k flag disables the rotation.
The -o flag disables the rotation and tells mailstat to instead examine
the old (already rotated) logfile.
The -l flag adds a column giving the average message size for each folder.
The -t flag eliminates the header and totals (easier for other programs
to parse).
The -s flag disables the message given for empty mailboxes.
The -m flag merges the non-folder lines into one entry
## diagnostic messages ##
under which they are all totaled.
(Harumph, I should probably just rewrite the above as a manpage.)
Philip Guenther