[Mailman-Users] Program to Change List Real Name

Mark Sapiro mark at msapiro.net
Thu Jun 2 17:04:37 CEST 2011


On 6/1/11 8:51 PM, UUN Hostmaster wrote:
> Mailman Folks,
> 
> Who do I convert these manual instructions into a program?
> 
>          bin/withlist bar
>          >>> m.real_name='bar'
>          >>> m.Lock()
>          >>> m.Save()
>          >>> m.Unlock()
>          >>> ^D

First of all, that is wrong. the m.Lock() will reload the list object
and undo the m.real_name='bar'. Just add -l to the withlist command and
don't do either m.Lock() or m.Unlock().

To make a script, put something like

def rename_list(mlist):
    if not mlist.Locked():
        mlist.Lock()
    mlist.real_name = mlist.internal_name()
    mlist.Save()
    mlist.Unlock()

in a file named rename_list.py in Mailman's bin/ directory and then you
can run

bin/withlist -r rename_list bar

However, if this is cPanel there may be problems with the above.

-- 
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