Skip to content

Instantly share code, notes, and snippets.

@lisa
Created March 18, 2010 17:57
Show Gist options
  • Save lisa/336643 to your computer and use it in GitHub Desktop.
Save lisa/336643 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Usage: membercheck_sh <email1> [email2] [email3] [emailn..]
for listname in `/usr/lib/mailman/bin/list_lists | grep -v "matching mailing" | awk -F ' - ' '{print $1}'| tr -s " "`
do
members="$(/usr/lib/mailman/bin/list_members $listname | tr '\n' ',')"
echo "${listname}:${members}" >> /tmp/list_members.txt
done
for address in $@
do
echo $address
grep $address /tmp/list_members.txt | awk -F ':' '{print $1}'
echo
done
/bin/rm -f /tmp/list_members.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment