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 Software Foundation Fellow,創辦 Open Source Hong Kong、香港開源年會及 PyCon HK,曾任 GNOME Foundation 董事,現為開發者關係專家,致力推廣開源軟件、開放數據與開源 AI。

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.