Journal mennucc1's Journal: procmail statistics
if you use procmail, you may like this snippet of
shell script:
LOG=~/var/log/procmail.log
first_time=`head $LOG | grep '^From' | \
head -1 | cut -d' ' -f3-`
first_ctime=`date -d"$first_time" '+%s'`
last_ctime=`date '+%s'`
echo EMAIL Statistics, average messages per day
egrep '^ *Folder' $LOG | awk '{print $2}' |\
sort | uniq -c | \
awk '{ print $1 * 86400 / ( '$last_ctime' - '$first_ctime' ) " " $2 }'
I had set the procmail rule
:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*
/dev/null
and I found out that spamassassin dunks ~130 messages a day into /dev/null WOW that is a lot
more than I would think.
I have put the above script in ~/etc/cron.weekly (see previous post).
LOG=~/var/log/procmail.log
first_time=`head $LOG | grep '^From' | \
head -1 | cut -d' ' -f3-`
first_ctime=`date -d"$first_time" '+%s'`
last_ctime=`date '+%s'`
echo EMAIL Statistics, average messages per day
egrep '^ *Folder' $LOG | awk '{print $2}' |\
sort | uniq -c | \
awk '{ print $1 * 86400 / ( '$last_ctime' - '$first_ctime' ) " " $2 }'
I had set the procmail rule
* ^X-Spam-Level: \*\*\*\*\*\*\*\*
and I found out that spamassassin dunks ~130 messages a day into
I have put the above script in ~/etc/cron.weekly (see previous post).