[Mailman-Users] Setting Up a List Via Command Line?

Ivan Fetch ifetch at du.edu
Fri Feb 4 17:10:40 CET 2005


Hello,

    Apologies this reply is a bit late - I've been working on something 
simelar for our setup and just got it to do what I want this morning.


    For completeness sake, here is my process (we are migrating mailing 
lists to mailman):


    1. Create the list with:
newlist list_name list_admin separately_randomly_generated_password

    2. As we're migrating lists from some home made list software, convert 
the list parameters to python variables, store those variables in a file, 
then apply them to the list with:
config_list -i file_of_python_variables.py list_name

    3. Convert our list of existing subscribers to a file with one address 
per line, and subscribe them with:
sync_members -a=no -g=no -w=no -f file_of_subscribers list_name
       Note - I'm pondering not disabling the subscription welcome, and 
changing the template to contain migration specific info for the list 
subscribers.

    4. Run a couple of python functions against the list to (1) fix the "-1 
Pending Requests" issue and (2) set the moderator bit to False for the 
list administrator:
withlist -q -l -r du.fixNegativePendingRequests list_name
withlist -q -l -r du.setMemberModeratedFlag list_name address_of_list_admin


    Here is the python (du.py) with the two functions - this can definitely 
be improved as soon as I actually learn python:
# DU mailman Modules
# This should live in the base Mailman install directory to be seen by the withlist Mailman binary.

from Mailman import mm_cfg
from Mailman.Errors import NotAMemberError

# Set a member's moderator flag to on or off
# e.g. to disable moderation: setMemberModeratedFlag listname, email_address, ''
def setMemberModeratedFlag (mlist, addr, mod):
#		print "Setting moderator flag to ",mod," for ",addr
 		mlist.setMemberOption (addr, mm_cfg.Moderate, mod)
 		mlist.Save()
# Error checking would be nice as soon as I get the syntax right.

# Fix an issue where a newly created mailing list sends emails to the list admin
# about "-1 pending requests" because a requests python pickle does not yet exist.
# BY querying the list for the number of requests pending, this file will get created.
def fixNegativePendingRequests (mlist):
 	klugevar=mlist.NumRequestsPending()
 	mlist.Save()



    I hope this helps if you haven't already solved your problem,
Ivan Fetch.


On Thu, 3 Feb 2005, Hunter Hillegas wrote:

> I have a need to do some list setup from the command line via another
> program. I am running 2.1.5.
>
> I am able to create the list and add members.
>
> One thing I would like to do is to set the moderation bit to true for all
> members and then set it to false for a single member.
>
> I am creating an announce list programatically.
>
> I am able to import the members no problem. How can I perform the moderation
> settings changes?
>
> Thanks,
> Hunter
>
>
> ------------------------------------------------------
> Mailman-Users mailing list
> Mailman-Users at python.org
> http://mail.python.org/mailman/listinfo/mailman-users
> Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
> Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
>
>



More information about the Mailman-Users mailing list