Smail3 log file parser

Randy Bush news at m2xenix.psg.com
Thu Dec 27 11:14:57 AEST 1990


[ in alt.sources because it contains a shell script to accomplish the same task
  as a previous posting ]

jeff at onion.pdx.com (Jeff Beadles) writes:

> What this program will do is simple.  It will take the smail3 logfile
> information, and produce a fairly human-readable report.

Your C code went infinite over here on Xenix/386 (after hacking rindex).  But
m2xenix's smail log has about 1k messages per day, and the matching entries can
be quite separated (I've see a hundred lines) as smail runs -q5m.

I have been using the following sort/awk hack to accomplish the same.  But it
goes a bit grotty with mailing lists and mail gated to a newsgroup via inews.

- - - - - - - - - - - - - -   c u t   h e r e   - - - - - - - - - - - - - -

sort +2 -3 < /spool/smail/log/logfile | awk '
{  if ($4 == "new") printf ("%s %s => ", $2, $7)
   else if ($6 == "delivered") print ($4) }' | sort

- - - - - - - - - - - - - -   c u t   h e r e   - - - - - - - - - - - - - -

So, what a fellow smailer at a more anal site wants now is a bytecount per
sender and recipient.

And now we should be hearing from the perl hackers.  Or will the INTERCAL
-- 
..!{uunet,qiclab,intelhf,bucket}!m2xenix!news



More information about the Alt.sources mailing list