Xref: utzoo comp.mail.sendmail:2850 comp.lang.perl:4519 Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!bradley.bradley.edu!pallas!dlee From: dlee@pallas.athenanet.com (Doug Lee) Newsgroups: comp.mail.sendmail,comp.lang.perl Subject: Re: Tools to analyze mail log Summary: C code to do this from "xferstats"; easily modifiable for mail logs Message-ID: <1006@pallas.athenanet.com> Date: 28 Feb 91 07:30:04 GMT References: Lines: 36 In article ehrlich@cs.psu.edu (Dan Ehrlich) writes: >Does anyone have or know of any tools that will analyze a sendmail log? I >am looking for statistics like number of messages/bytes to/from by >host/user. If there is something out there that will do this (do not really >care if its C code, awk, perl, etc) I would appreciate hearing from you. If you don't send/receive your mail via uucp, this probably won't help; but it sounds like you're asking for a report like: Incoming Outgoing User System Nfiles Size Time Nfiles Size Time CPS daemon uunet 8 14187 00:00:28 0 0 00:00:00 499.7 dlee uunet 0 0 00:00:00 2 1217 00:00:01 1644.6 fred bradley 2 1587 00:00:05 0 0 00:00:00 327.9 kabra437 bradley 0 0 00:00:00 6 4439 00:00:03 1700.8 lbert359 bradley 0 0 00:00:00 2 1371 00:00:01 1651.8 lbert359 uunet 0 0 00:00:00 2 1398 00:00:01 1664.3 news bradley 260 10642428 03:15:00 0 0 00:00:00 909.6 uucp bradley 6 2022 00:00:12 0 0 00:00:00 171.5 uucp uunet 4 3263 00:00:11 0 0 00:00:00 304.7 I just wrote this a couple of days ago! The only problem I can see is that the "user" field is *not necessarily* the user responsible for the transfer (my outbound mail shows up as "dlee"; it returns as "uucp" or "daemon"). At any rate, I can send it to you (or anyone else) if you are interested. I would also be willing to modify it to eat your sendmail logs, as this should not be too complicated. Mail me a sample. This is one of the tasks I found hard in PERL, since there are no (officially, anyway) multi-dimensional arrays. That's one of the *few* things I miss in PERL. -- Doug Lee (dlee@athenanet.com or {bradley,uunet}!pallas!dlee)