[Mailman-docs] Re: [Mailman-Users] How to get Sender Id from the Mailing List where the annoymous option is set

Jon Carnes jonc at nc.rr.com
Sun Feb 27 22:02:23 CET 2005


On Thu, 2005-02-17 at 16:23, Brad Knowles wrote:
> At 3:57 AM -0800 2005-02-08, vijayan p wrote:
> 
> >  Can anyone tell me how to obtain the statistics of
> >  which member has posted how many messages.
> 
> 	I think you'd have to look at the incoming messages in the MTA 
> logs, before they get handed off to Mailman.  But keep in mind that 
> Mailman does not have any facility for creating or monitoring 
> statistics, unless you want to create a script to do that.
> 

It's also recorded in Mailman's logs (the "post" log).

> >  Also is there a way to know who has posted a
> >  particular mail.

Yes. look at the post log.

Here is a stats script which does some of what you asked. I wrote it
about 3 years ago...

[jonc at Anncons4 Useful_scripts]$ more mm_stats
#! /bin/bash
# Run monthly stats on Meeting maker logs
#  - top 10 users of each list
#  - Number of attempted posts (per list)
#  - Total bytes sent (per list)
# written by Jon Carnes, last modified on Sept 26, 2002
#
# Mailman's log file to be examined for stats
#POST=/home/mailman/logs/post
#
# Run this script the first of the month right after the
#  the log files have been rotated.  The log file for the
#  previous month will then be post.1
POST=/var/log/mailman/post.1
  
# create temp file to collect stats
TMPFILE=`mktemp /tmp/mm_stats.XXXXXX` || exit 1
  
LIST="`/var/mailman/bin/list_lists |awk '{print $1}' |sed -n '2,$p'`"
for i in $LIST
do
  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 collected stats off to the list admin and cc the mailman user
  mail -s "Mailman Stats for List: $i" -c mailman $i-admin <$TMPFILE

done
  
# remove the temp file
rm $TMPFILE

===

Jon Carnes




More information about the Mailman-Users mailing list