Commit c326fbce authored by taggart's avatar taggart

new script to determine which lists a list of addresses are on

parent 6cafcb75
#!/usr/bin/perl -w
# findcommonlists - given a list of addresses find the top lists with them subscribed
# NOTE: this script requires the current user has read access to the db
# Matt Taggart <> 2019-08
if (!$ARGV[0]) {
print "usage: findcommonlists <file>\n";
$listsql='mysql -N --batch --database=sympa --execute "select list_subscriber,user_subscriber from subscriber_table, list_table where list_subscriber=list_table.name_list and list_table.status_list=\'open\'"';
open(ADDRESSES, "$file") or die "cannot open $file\n";
open(LISTDUMP, "$listsql|") or die "cannot get dump of address+list pairs from database\n";
while (<ADDRESSES>) {
while (<LISTDUMP>) {
# match list and sane address
if ( exists($addresses{$address}) ) {
foreach $list ( sort { $found{$b} <=> $found{$a} } keys %found) {
print "$found{$list} $list\n";
if ( $count == $limit ) {last;}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment