I sometimes get asked how many messages are sent out to a mail list.
So I wrote a script to tell me. This works under ksh or bash.
The script is attached and I am happy for this to become part of mailman or put into an associated library.
You need to run it in the list's archive directory.
Regards
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include
On Fri, Feb 07, 2014 at 05:23:22PM +0000, Alain Williams wrote:
I sometimes get asked how many messages are sent out to a mail list.
So I wrote a script to tell me. This works under ksh or bash.
The script is attached and I am happy for this to become part of mailman or put into an associated library.
You need to run it in the list's archive directory.
Drat, this list does not allow attachments, so here it is in line:
# Show how much email sent through a mailman mail list # Copyright (c) Alain Williams addw@phcomp.co.uk January 2009 # This program is free software and is licenced under the GPL: http://www.gnu.org/copyleft/gpl.html
# This should be run in a directory like: # /var/spool/mailman/bray/archives/private/chat # Note that this needs write access to the directory since it creates a temporary # directory.
echo "Columns: month number-of-messages total-message-size" Months="January February March April May June July August September October November December" FilesTot=0
# Work out starting year, look for something like: 2004-December startYear=$( ls | perl -wlne '$year = $1 if(/^(\d\d\d\d)-/ and ( !defined($year) or $1 < $year)); END {print $year }' ) endYear=$( date '+%Y' )
for year in $( seq $startYear $endYear ) do echo "Year $year" YearTot=0 for month in $Months do [[ ! -d $year-$month ]] && printf "$year $month\tnone\n" && continue cd $year-$month || exit mkdir x || exit ln [0-9]* x cd x || exit files=$( ls -f | wc -l ) (( FilesTot += files )) (( YearTot += files )) printf "$year $month\t$files\t$( du -h | cut -f 1 )\n" cd .. || exit rm -rf x cd .. || exit done echo "Total for year $year: $YearTot" done echo "Emails total $FilesTot"
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include
On 02/07/2014 09:33 AM, Alain Williams wrote:
The script is attached and I am happy for this to become part of mailman or put into an associated library.
You need to run it in the list's archive directory.
Drat, this list does not allow attachments, so here it is in line:
Actually, it does but only of MIME type text/plain or text/x-diff.
I have attached a revision. Changes include:
It only needs read access to Mailman's archives.
It can run from anywhere.
Granted the total-message-size is a bit off because it includes the various index files, but it's close in most cases, and since it includes all the html boiler plate, it isn't that accurate to begin with.
I can add this to the contrib directory in the distribution.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Alain Williams
-
Mark Sapiro