At 1:56 PM -0500 12/22/01, 323  imposed structure on a stream of 
electrons, yielding:
>How can I count the number of emails sent and received using SIMS logs?

Perl seems to me like the best tool...

The messages sent and received are logged at level 2 of the SMTP 
module with lines that look like this:

15:37:19 2 SMTP-069(zorch.sf-bay.org) [S.0000124316] sent, 1679 bytes

and this:

15:37:52 2 SMTP-070(n18.groups.yahoo.com) {S.0000124317} received, 2534 bytes

If all you want is a raw count, the code would be simple. The 
following regular expressions should match the lines without any 
false positives:

^[0-9][0-9]:[0-9][0-9]:[0-9][0-9] 2 SMTP-[0-9][0-9][0-9]([^ ]*) 
{S.[0-9]*} received, [0-9][0-9]* bytes$ 
^[0-9][0-9]:[0-9][0-9]:[0-9][0-9] 2 SMTP-[0-9][0-9][0-9]([^ ]*) 
\[S.[0-9]*\] sent, [0-9][0-9]* bytes$

I have no idea why Stalker decided to use [] for sent and {} for received.
-- 
Bill Cole
[EMAIL PROTECTED]


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[EMAIL PROTECTED]>.
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
To switch to the DIGEST mode, E-mail to <[EMAIL PROTECTED]>
To switch to the INDEX mode, E-mail to <[EMAIL PROTECTED]>
Send administrative queries to  <[EMAIL PROTECTED]>

Reply via email to