Last Updated: February 25, 2016
·
723
· miketheman

Extracting Mailman member lists

Since Mailman is pretty much a de-facto mailing list manager that is pretty pervasive across the Internet, especially with managed hosting providers, getting your membership list can prove difficult at best

If you are an admin to a list, but not a member, getting a cohesive list of names and emails is almost impossible with the provided tools.

Using a rubygem named Mechanize, which in turn uses Nokogiri, we can make a cookie-authenticated session request to the membership page, and parse the members table for the details.

I've pasted a public gist of this code here.

It clocks in at 33 lines of actual code, and some of that could probably be shortened even further.

Enjoy!