[Mailman-Users] [Fwd: list statics]

Jim Popovitch jimpop at yahoo.com
Sat Jul 5 19:45:10 CEST 2003


Here's one that I use to produce a simple report of members per virtual
domains:

-------------- BEGIN SCRIPT (mailman-report.sh) -------------------
#!/bin/sh

# v1.0
# Created by Jim Popovitch <jimpop at yahoo.com> 2003-06-30
#
#
# This script creates a report showing you the number of members
# per virtual domain.  You can run the script every month from cron
# and pipe the output to an email like this:
#
#  mailman-report.sh domain1.com | mail -s "Monthly Mailman Report"
admin at domain1.com
#
#

## Make sure that this points to your correct Mailman base location:
MMBASE=/home/mailman


##
#
# Check that a domainname was specified
#
if test -z "$1"; then
  echo
  echo "     SYNTAX: `basename $0` <virtual_domain>"
  echo
  exit 1
fi

#
#
LISTS=`$MMBASE/bin/list_lists -V $1 | grep " - " | awk '{ print $1 }'`
EXEC=$MMBASE/bin/list_members
DATE=`date +"%d %B-%Y"`

#
# Allocate some temp files based on virtual domain
TMPPAGE=/tmp/$1-report-page.$$
touch $TMPPAGE
TMPFILE=/tmp/$1-report-list.$$
touch $TMPFILE


#
# Print the header
#
echo "________________________________________"
echo "$DATE report for $1"


#
# Verify that we have something to report on
#
if test -z "$LISTS"; then
    echo
    echo "**there are no lists for this domain"
    echo
    exit 0
fi


#
# crawl the lists, counting members
#
for list in $LISTS; do
  echo -n "$list " >> $TMPPAGE;
  $EXEC $list | tee --append $TMPFILE | wc -l >> $TMPPAGE;
done


#
# Print the report
#
echo "________________________________________"
awk 'BEGIN{printf("%-30s%-10s\n","List Name","Members")}'
echo "________________________________________"
cat $TMPPAGE | awk '{printf("%-30s%-10s\n",$1,$2)}'
echo "________________________________________"
cat $TMPFILE | wc -l | awk '{printf("%-30s%-10s\n","Total Members:",$1)}'
sort -ui $TMPFILE | wc -l | awk '{printf("%-30s%-10s\n","Unique
Members:",$1)}'
echo


#
# Clean up
#
rm -f $TMPFILE
rm -f $TMPPAGE
-------------- END SCRIPT -------------------



> -----Original Message-----
> From: mailman-users-bounces+jimpop=yahoo.com at python.org
> [mailto:mailman-users-bounces+jimpop=yahoo.com at python.org]On Behalf Of
> veryaner
> Sent: Friday, 04 July, 2003 16:32
> To: mailman-users at python.org
> Subject: [Mailman-Users] [Fwd: list statics]
>
>
> hi everybody,
> I need a module or something to show my list statics? is this posible?
> I want to show, the user who send more mails, and that kind of things...
> thanks in advanced
> veryaner
>
> --
>
> --
>
>
>
> ------------------------------------------------------
> Mailman-Users mailing list
> Mailman-Users at python.org
> http://mail.python.org/mailman/listinfo/mailman-users
> Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
> Searchable Archives:
http://www.mail-archive.com/mailman-users%40python.org/

This message was sent to: jimpop at yahoo.com
Unsubscribe or change your options at
http://mail.python.org/mailman/options/mailman-users/jimpop%40yahoo.com






More information about the Mailman-Users mailing list