Here is the script

I call it from crontab and pipe the output to a file right before logrotate.

ev
At 08:19 05.12.2003, Joe Emenaker wrote:
Evelyn Pichler wrote:

I have a script that finds all successful deliveries and lists size, from and to.

If that is enough for you I can mail it to you.

I'm very interested in that, too. Perhaps you should post it to the list.


If I have time, I'd be interested in hacking it up so that it could store the entries in a mysql db to allow for more intricate queries.

- Joe


*2*
#!/bin/sh
# ex: ts=3 syntax=off

# Apr  7 06:34:13 host courieresmtp: id=000000C2.3E90FFB2.0000554B,from=<[EMAIL 
PROTECTED]>,addr=<[EMAIL PROTECTED]>,size=3024000,status: success


egrep 'courieresmtp:.*status: success' /var/log/maillog \
        | sed 's/^\(.*addr=<[^<>]*\),\([^<>]*>.*\)$/\1.\2/g' \
        | awk '{printf ("%s;%s;%s;\n", substr($4,6), substr($2,7,length($2)-7), 
substr($3,7,length($3)-7));}' 'FS=,'

Reply via email to