[Mailman-Users] Program for dumping out users passwords...

Jon Carnes jonc at haht.com
Thu Feb 7 21:44:52 CET 2002


#! /bin/bash
# Script to dump out the text passwords of Mailman users
# Input is a valid Mailman list
#
LIST="`~mailman/bin/list_lists |awk '{print $1}' | \
          grep -iw $1 2>/dev/null |tr [A-Z] [a-z] `"
if [ "xxx$LIST" = "xxx" ]; then
   echo "ERROR: missing valid listname"
   echo "  "
   echo "You must choose a valid Mailman list on this server:"
   ~mailman/bin/list_lists
   echo " "
   echo "ERROR: command aborted!"
   exit 0
fi
#
# Dump the database to text
~mailman/bin/dumpdb ~mailman/lists/$LIST/config.db >/tmp/~mm.$LIST
#
# Isolate the password section of the database
STRT=`grep -n "'passwords': {" /tmp/~mm.$LIST |cut -f1 -d: `
sed -n "$STRT,\$p" /tmp/~mm.$LIST >/tmp/~mm2.$LIST
rm /tmp/~mm.$LIST
#
echo $1":"
for i in `/home/mailman/bin/list_members $LIST `
do
  PASS=`grep -i $i /tmp/~mm2.$LIST |head -1 |cut -f4 "-d'"`
  if [ "xxx$PASS" = "xxx" ]; then PASS="#blank_password#" ; fi
  echo "  "$i "   " $PASS
done
rm /tmp/~mm2.$LIST

# Jon Carnes





More information about the Mailman-Users mailing list