[Mailman-Users] Mailman stat's
Jon Carnes
jonc at nc.rr.com
Fri Feb 7 16:01:39 CET 2003
As promised, my simple script to find users who have been moved to
"no_mail" status due to bounces. (see end of email)
You could easily modify it to send out a notification to the list admins
*and* auto-remove these addresses from all lists. I have no problems
with auto-removing an address that is bouncing - and since the address
*is* bouncing, you have no way of alerting the user and telling them
that they have been removed from the list... I get too much mail any
way!
Jon
On Fri, 2003-02-07 at 03:10, Jon Carnes wrote:
> Dang it! I've got another script that does exactly that... I should have
> included it. I'll dump it on the list when I get done with this job
> (sometime - hopefully - tomorrow). It's a fairly simple script that I run
> monthly - only it uses the log entries and isolates the entries that
> indicate a user has been moved over to no-mail due to excessive bounces.
>
> Jon Carnes
> ----- Original Message -----
> From: "Larry Hansford" <lhansfor at lch-assoc.com>
> > Thanks for the script, Jon! Looks great.
> >
> > I've trying to develop a script to run the "bin/list_members --nomail" for
> > each mailing list once a month, with the results mailed to the list
> > administrator. Does anyone have an easy way to accomplish that? The
> > reason I want to generate those reports is to allow the list owners to see
> > which members have been set to nomail due to bounces and need attention.
> >
> > Again, thanks!
> >
> > Larry
> >
> >
> >
>
>
> ------------------------------------------------------
>
#!/bin/bash
# mm_bounces: sends an email of bounced folks to the mailman admin list
# Note, these bounced emails have been automatically set to "no mail"
# for the Mailman lists that they were a part of.
# create temp file to collect stats
TMPFILE=`mktemp /tmp/mm_stats.XXXXXX` || exit 1
# Note: this should be run on the first of the month
# The script checks for bounces from the previous month
MONTH="`date -d"last month" +%b`"
echo "A list of emails from $MONTH that were bouncing" >$TMPFILE
echo "but are still subscribed to local Mailman lists." >>$TMPFILE
echo "The addresses were automatically set to _no_mail_" >>$TMPFILE
echo "in the specified lists, due to the bounces." >>$TMPFILE
echo "You should consider deleting these addresses from" >>$TMPFILE
echo "all Mailman lists:" >>$TMPFILE
echo "~mailman/bin/remove_members --fromall email at address" >>$TMPFILE
echo " " >> $TMPFILE
echo "======" >> $TMPFILE
# We rotate our logs monthly on the first of each month at 4am
# so we really only need to check last months bounce log: bounce.1
grep -hs "disabled " /home/mailman/logs/bounce.1 \
grep -vs "already disabled" | \
grep -s $MONTH | \
cut -f6- "-d " |sort >> $TMPFILE
# Test to see if there was any output from the log
TEST="`tail -1 $TMPFILE`"
if [ "$TEST" = "======" ]; then rm $TMPFILE; exit 0; fi
# TEST indicated there were email addresses disabled last month
# So we need to send this message to admin at domain.com
cat $TMPFILE |mail -s "$MONTH: Mailman disable list" admin at domain.com
rm $TMPFILE
More information about the Mailman-Users
mailing list