[Mailman-Users] List all members of All lists

Harold Pritchett harold at uga.edu
Sat Nov 21 15:31:53 CET 2009


Martin Schütte wrote:
> Harold Pritchett wrote:
>> How do I list all of the members of all of my lists.

Thanks for the ideas.  Here's what I ended up with:

#!/bin/bash

USER=$(/usr/bin/id -un)

if [ $USER != root ] ; then
     echo This command must be run as root
     exit
fi

if [ $# -ne 1 ]
   then
   echo "Usage:"
   echo ""
   echo "delete_domain_from_all_lists addr"
   echo ""
   echo "Options:"
   echo ""
   echo "addr is the domain  address to remove. (required)"
   echo ""
   exit
fi

cd /usr/lib/mailman/bin

./list_lists -b | while read L
do
         ./find_member -l ${L} $1 |      \
                 grep \@ |               \
                 cut -d " " -f 1 >>      \
                 /tmp/found-mailman
done

sort -u < /tmp/found-mailman > /tmp/found2-mailman
echo "The following userids will be deleted from ALL"
echo "Mailman mailing lists on this server."
echo
cat /tmp/found2-mailman
echo
echo Proper response must be '"Yes" (with a capital letter Y)'
echo Anything else and the delete wlil be aborted
echo -n "Continue [Yes|No]":" "
read response
echo

if [ "$response" == "Yes" ]; then
./remove_members --fromall --nouserack -f /tmp/found2-mailman
else
         echo Delete aborted...
fi

rm /tmp/found-mailman /tmp/found2-mailman




More information about the Mailman-Users mailing list