[Mailman-Users] Batch Add/Remove Users via Mail

Mark Sapiro mark at msapiro.net
Tue Mar 27 21:19:16 CEST 2012

Leo Hackstein wrote:
>I am tasked to write a script that adds multiple users to a mailing
>list. The List of users is generated from a different database.
>Unfortunately, the script will not be running on the same machine as the
>mailing list is hosted, so as I understand it, I cant use the scripts in
>"/usr/lib/mailman/bin" (or wherever mailman resides on that machine).


>Now I thoght I will just send mailman a mail with lines
>"subscribe $password address=$address"
>but it seems like $password is in this case the password for the user of

It is the password to be generated for the newly subscribed user.

>So in theory I could write
>"subscribe address=$address",
>but I have no idea what exactly will happen then. I myself am not
>administrator on the mailing list, so I can't experiment.

That is a request to subscribe $address with whatever the digest
default is for the list and an autogenerated password. What happens
after that is a function of the list's subscribe_policy, but in the
most usual cases, it results in a confirmation request email being
sent to $address.

>Are the users automatically subscribed to the mailing list, if the mail
>with the subscribe-statements is sent from a list administrator? How
>does the administrator authenticate, then?

No they are not. There is no list admin authentication available for
this process. The subscribe command with address= option is treated
the same regardless of who sends it.

>Are all users that get subscribed in that way getting a confirmation
>mail where they have to approve their subscription? That would be OK, I

As I indicated above, that's the normal case, but it depends on the
list's subscribe_policy.

>Does the list administrator have to manually approve the subscriptions
>again, if they are sent with a mail?

Again, that depends on subscribe_policy. Here are the possiblities for

 None (only available if ALLOW_OPEN_SUBSCRIBE is set to Yes in
       mm_cfg.py) - User is subscribed.
 Confirm - User is send confirmation request and is subscribed upon
 Require approval - No mail to user. Owner or Moderator must approve.
 Confirm and approve - Confirmation email. After confirmation Owner
                       or Moderator must approve.

>Are there better ideas?
>Using the Web Interface is not an option (the web interface is used at
>the moment, but as we need the script anyway to generate the user list,
>it would be very convenient if the script could also add the new users
>If you know of a script (ideally written in perl) that uses some kind of
>http agent to access the web interface to add/remove users, that would
>be cool, too.

See the latter portion of the FAQ at <http://wiki.list.org/x/uIA9>.

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list