Change list owners from command line

Asked by Dale Toney

We have over two hundred lists that need the domain of the list owners changed.
Is there a way to do this from command or do each list have to be individually edited and save?
I tried modifying the individual config.pck files for the lists, but ended up corrupting the files.

Thanks for any assistance or insight.

Dale

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Mailman Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Mark Sapiro (msapiro) said :
#1

If the owners are the same for all lists, see the FAQ at <http://wiki.list.org/x/MIBp>. If not, a withlist script is easiest. The indentation here is going to be munged, here's a 5-line script (4 lines if you omit moderator).

def change_owner(mlist):
    mlist.owner = [x.replace('example.com', 'example.net') for x in mlist.owner]
    mlist.moderator = [x.replace('example.com', 'example.net') for x in mlist.moderator]
    mlist.Save()
    mlist.Unlock()

The first line above is not indented and the second through fifth lines are indented 4 spaces. This can be saved in Mailman's bin/ directory with name change_owner.py and run by

bin/withlist -l -a -r change_owner

(note no .py extension in the withlist command line.) This will change 'example.com' to 'example.net' in all owner and moderator addresses in all lists. Replace those in the script with the actual old and new domains.

Can you help with this problem?

Provide an answer of your own, or ask Dale Toney for more information if necessary.

To post a message you must log in.