[Mailman-Users] automatically subscribe

John Heim jheim at math.wisc.edu
Mon Oct 9 18:06:54 CEST 2006


----- Original Message ----- 
From: "Mark Sapiro" <msapiro at value.net>

> For a different approach see
> <http://mail.python.org/pipermail/mailman-users/2006-October/053679.html>
> and the other post to which it refers.
>


Thanks Mark.

Again for the archive, I thought I'd include a perl script I wrote to  use 
the url/post approach:

#!/usr/bin/perl

use strict;
  use LWP::UserAgent;

my $mydomain = 'mydomain.com';
my $email_address = 'jheim at mydomain.com';
my $adminpw = 'password';
my $list = 'listname';

# use script name for agent
my $ua = LWP::UserAgent->new;
my ($agent) = $0 =~ m#.*/(.*)$#;
$ua->agent("$agent.1 ");

my $form = {};
$form->{subscribees} = $email_address;
$form->{adminpw} = $adminpw;
$form->{send_welcome_msg_to_this_batch} = 1; # could be 0
$form->{send_notifications_to_list_owner} = 1; # could be 0

my $url = "https://$mydomain/mailman/admin/$list/members/add";
my $res = $ua->post ($url, $form);
#Check the outcome of the response

[...] 




More information about the Mailman-Users mailing list