LoginSignup
1
1

Mailman のメーリングリストメンバーを全部出力する

Posted at

目的

Mailman で管理されているすべてのメーリングリストのすべてのメンバーをファイルに出力する。

手順

1. Mailman のディレクトリを特定する

Mailman Web サーバの本体スクリプトやユーティリティコマンドなどが入っているディレクトリがどこかにあるはず。
気合いで探す。

筆者の環境では /usr/lib/mailman だった。
以下はこのディレクトリの前提で進める。

2. ワンライナーをポンする

cd /usr/lib/mailman/bin
( echo 'list name,destination' && for list in $(sudo ./list_lists -b); do sudo ./list_members "$list" | sed "s/^/$list,/"; done ) | tee ~/lists-dump.csv

実行すると、以下の形式で CSV ファイルが得られる。

lists-dump.csv
list name,destination
list-a,user1@example.com
list-a,user2@example.com
list-b,user3@example.com
list-b,user4@example.com

おわり。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1