[Mailman-Users] List all members of All lists
Adam McGreggor
adam-mailman at amyl.org.uk
Fri Nov 20 20:38:24 CET 2009
On Fri, Nov 20, 2009 at 02:10:06PM -0500, Harold Pritchett wrote:
> How do I list all of the members of all of my lists.
>
> Actually, I need to delete all users from a domain
> and the command "remove_members --fromall --nouserack"
> does not accept wildcards.
>
> If I can get a list of all users, I can then grep it
> for the domain name and run remove_members for each
> of the users which are found.
I'd probably use something like
find_member example.com > outfile
which will give you the email address and list memberships; this can
be fed to remove_members. That may need some tidy-up, though.
Another approach I might consider would be to use list_lists -b, and a
while loop; something like: (untested)
list_lists -b | while read L
do
find_member -l ${L} example.com > found-${L}
remove_members --fromall --nouserack -f found-${L} ${L}
rm found-${L}
done
Maybe skipping the outfile, but I like outfiles, rather than
pipes/redirects.
maybe feeding stuff through tee(1), although logs/subscribe should log
those, appropriately.
(I'd probably use the second suggestion, myself, having tested it
first with a regexp that wouldn't do much damage.)
--
''meetings, n.:
A place where minutes are kept and hours are lost.''
More information about the Mailman-Users
mailing list