simple, stupid mailman -> pmg subscriber import
Chris Nehren [Sun, 20 Jun 2010 04:12:55 +0000 (00:12 -0400)]
bin/mm2pmg [new file with mode: 0644]

diff --git a/bin/mm2pmg b/bin/mm2pmg
new file mode 100644 (file)
index 0000000..b167230
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use Promulger::List;
+
+use IPC::Run3;
+
+@ARGV == 2 or die "usage: $0 mailman_list_name pmg_list_name";
+my ($mm_list_name, $pmg_list_name) = @ARGV;
+my $pmg_list = Promulger::List->resolve($pmg_list_name);
+die "no such list: $pmg_list_name\n" unless $pmg_list;
+
+run3 ['list_members', $mm_list_name], undef, \&add_member, undef;
+
+sub add_member {
+  my ($member) = @_;
+  chomp $member;
+  $pmg_list->subscribe($member);
+}