Counting no. of mailman list subscribers

Just wrote a shell script quickly. It can count number of valid subscribers in every Mailman-driven mailing lists. This piece of code is licensed in GPL. 😉

#!/bin/sh
# Counting valid no. of list subscribers in mailman
for i in `list_lists -b`
do
total=`list_members ${i} | wc -l`
nomail=`list_members -n ${i} | wc -l`
valid=`echo ${total} – ${nomail} | bc -l`
echo ${i}: ${total} – ${nomail} = ${valid} valid email addrs.
done

Running Result:

team-a: 123 – 0 = 123 valid email addrs.
team-b: 456 – 78 = 378 valid email addrs.

About Sammy Fung

Sammy Fung 是開放源碼倡導者,Python軟件基金會資深會員。他創辦開源香港、香港開源年會及 PyCon HK,曾任GNOME基金會董事。他在亞洲各城市籌辦過30場開源會議及開放數據黑客松。

One Reply to “Counting no. of mailman list subscribers”

  1. Thanks. I quickly run it for voyage linux mailing list and it shows:

    voyage-announce: 76 – 0 = 76 valid email addrs.
    voyage-linux: 401 – 12 = 389 valid email addrs.