[Mailman-Users] Program to Change List Real Name

Mark Sapiro mark at msapiro.net
Thu Jun 2 23:49:05 CEST 2011


On 6/2/2011 2:13 PM, UUN Hostmaster wrote:

Mark Sapiro wrote:

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

> What kinds of problems do you anticipate with cPanel Mailman?
> 
> I looked at the config_list of a CPanel Mailman mailing list:
> list-name_domain-name.tld.  It appears like a normal Mailing installation
> except that the real_name = "list-name"   Otherwise, the folders and files
> are named list-name_domain-name.tld


That's the point. The script I posted with

   mlist.real_name = mlist.internal_name()

will set real_name to the list-name_domain-name.tld name rather than
just list-name.


> I am migrating some Majordomo Mailing lists to a CPanel Mailman installation.


So what are you really trying to accomplish? If you create the lists
with cPanel's list create process (as opposed to Mailman's bin/newlist)
they should get the appropriate real_name.

If you explain in more detail what you are doing and what needs to be
fixed about the lists' real_name, I can give you a script to do it.

If the issue is that you have lists with real_name =
list-name_example.com and you want to change real_name to just
list-name, put the following script in
/usr/local/cpanel/3rdparty/mailman/bin/rename_list.py

def rename_list(mlist):
    if not mlist.Locked():
        mlist.Lock()
    listfullname = mlist.internal_name()
    last_underscore = listfullname.rfind('_');
    if last_underscore > 0:
        listname = listfullname[0:last_underscore]
    else:
        listname = listfullname
    mlist.real_name = listname
    mlist.Save()
    mlist.Unlock()

You can then run that with

bin/withlist -r rename_list foo_example.com

to do the foo_example.com list or

bin/withlist -r rename_list -a

to do all lists.

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