Top Ten Statistics in Mailman

9 12 2006

If you want to know who is the top ten “Junkers” in your Mailing List (using Mailman), you can use this script :

=== begin script: mm_stats ===

#! /bin/bash

# Run monthly stats on Mailman logs

# Mail stats to each lists admin

#  - Number of attempted posts

#  - Number of Successful posts

#  - Total bytes sent

#  - top 10 users of each list


# Mailman's log file to be examined for stats

POST=~mailman/logs/post# create temp file to collect stats

TMPFILE=`mktemp /tmp/mm_stats.XXXXXX` || exit 1

LIST="`/home/mailman/bin/list_lists |awk '{print $1}' |sed -n '2,$p'`"

for i in $LIST


  echo "Stats from local Mailman list: $i" > $TMPFILE

  echo " "  >> $TMPFILE

  echo -n "   Starting:  " >> $TMPFILE

  head -1 $POST |cut -f1-3 "-d " >> $TMPFILE

  echo -n "   Ending:    " >> $TMPFILE

  tail -1 $POST |cut -f1-3 "-d " >> $TMPFILE

  echo " ===" >> $TMPFILE

  echo -n "Total posts to the list: " >> $TMPFILE

  grep -i "post to $i " $POST |wc -l >> $TMPFILE

  echo -n "Total SUCCESSFUL posts to the list: " >> $TMPFILE

  grep -i "post to $i " $POST |grep success |wc -l >> $TMPFILE

  SIZ=`grep -i "post to $i" $POST |grep success |cut -f2 -d= |cut -f1 -d,`

  k=0; for j in $SIZ; do k=$(( j + k )); done

  echo "  Total bytes" = $k >> $TMPFILE

  echo " "  >> $TMPFILE

  echo "Top 10 posters to the list:" >> $TMPFILE

  grep -i "post to $i " $POST |cut -f 10 "-d " |sort |uniq -c

     |sort -bgr |head -10 >> $TMPFILE

  echo " " >> $TMPFILE

  # Mail the collected stats off to the list admin and cc the mailman user

  mail -s "Mailman Stats for List: $i" -c mailman $i-admin <$TMPFILE


# remove the temp file


=== end script: mm_stats ===

The script dumps out the names of all the local Mailman lists and then runs through the POST log for each list. It dumps the stats out to a temp file and at the end, emails the contents of the temp file to the list admins (and cc’s the mailman user).

Unlike some of my other scribblings to the list, this script is tested and actually works! Use it as your own risk, etc…

Again, any suggestions and modifications are welcome.

Jon Carnes

And the Result for Milis Junker EL02 is :

Stats from local Mailman list: el02

Starting:  Apr 16 20:20:31
Ending:    Dec 09 15:37:48
Total posts to the list:     2787
Total SUCCESSFUL posts to the list:     2783
Total bytes = 26407910

Top 10 posters to the list:

And of course in that list.. I’m still the Super Junker😀

*(taken from



7 responses

9 12 2006

wakaka,lgsg di posting, niat bener…
domainnya emang kecoret xxx gtu ya keluarannya chai?

9 12 2006

itu biar ga di spam Nic…
ati2 aja klo lo nyantumin email lo diinternet… spammer bertebaran dimana2… :no:

11 12 2006

aduh, aku tersingkir dari posisi nomer 6


11 12 2006

Ganbatte, Git!!

23 04 2007

mas scriptnya di taruh mana u menjalankannya Top Ten Statistics in Mailman sebelumnya thanks yaaaa ????

28 11 2007
24 08 2008

Maaf ni mas,saya sudirman 38thn.hanya pingin liat yg xxx.maklum deh nyobain hp br.trims dan mohon di bantu.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: