On 09/16/2015 03:53 PM, Montanez, Victor wrote:
> 
> I am wondering if there is a way to have several mailman lists created at 
> once via command line. I am talking about 100 lists or so. Otherwise creating 
> them through the GUI would take forever.
> 
> Maybe creating a file with list name, password,etc and passing that file to 
> the create binary?


Create your file with multiple lines of the form

list1 ow...@example.com password

Assume it's named 'lists'

Create a script like

#! /bin/bash
exec 5</path/to/lists
while read -u 5 list owner passwd; do
  /path/to/mailman/bin/newlist -q $list $owner $passwd
done

Then either give it +x permission and run it with

/path/to/script

or run it via

bash /path/to/script

This will create the lists without sending email notifications to the
owners. If you want the notifications and your Mailman is 2.1.20 or
newer, you can replace the newlist -q option with -a.

If you want the notifications and your Mailman is older, you can make
the newlist command in the script

 /path/to/mailman/bin/newlist $list $owner $passwd </dev/null

each invocation of newlist will produce a 'Hit enter to notify listname
owner...' prompt on stdout but the response will be read from /dev/null
so you don't have to 'Hit enter' for each one.

See 'bin/newlist --help' for more info.

-- 
Mark Sapiro <m...@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to