[Mailman-Users] Removing admin email addresses

Mark Sapiro msapiro at value.net
Tue Nov 20 06:30:32 CET 2007


Spyro Polymiadis wrote:
>
>There are 2 admins on there.. 1 person is on All of them, and the person who left is on about half of them.
>
>Which method would be best suited for that scenario?


If I understand correctly, The end result you want is for the one
remaining owner to be the single owner of all the lists. In this case,
by far the simplest and safest is to run config_list on all lists with
an input containing only the line

owner = ['remaining_owner at example.com']


>Also, is any of the script destructive to the lists themselves? Ie, if it didn't run right or something it wouldn't affect the list accepting emails to it, or blowing away the rest of the list config?


The config_list with the above input is safe. It won't change anything
but owner and it won't allow anything you couldn't enter via the web
interface.

If you screw up withlist, you can destroy a list or lists, but the
script below should be safe. Also, you can do a dry run by leaving out
the

    mlist.Save()

line. Then it won't actually change the list, so you could run withlist
with the script without the mlist.Save(), and if you're happy with the
output from the prints, replace the mlist.Save() and run it again.


>
>> -----Original Message-----
>> From: Mark Sapiro [mailto:msapiro at value.net]
>> Sent: Tuesday, 20 November 2007 3:29 PM
>> To: Spyro Polymiadis; mailman-users at python.org
>> Subject: Re: [Mailman-Users] Removing admin email addresses

<snip>

>> If the owner lists are different and you just want to remove
>> ownerx at example.com from all lists in which it is an owner, you can put
>> the following script in Mailman's bin directory, naming it del_owner.py
>>
>>
>> def del_owner(mlist):
>>     if not mlist.Locked():
>>         mlist.Lock()
>>     try:
>>         mlist.owner.remove('ownerx at example.com')
>>         print 'ownerx at example.com removed from %s' % mlist.real_name
>>     except ValueError:
>>         print 'ownerx at example.com not owner of %s' % mlist.real_name
>>     if not mlist.owner:
>>         print 'list %s has no owners' % mlist.real_name
>>     mlist.Save()
>>     mlist.Unlock()
>>
>> After saving the above as bin/del_owner.py, run
>>
>> bin/withlist -a -r del_owner
>>
>> Note that the file name is del_owner.py, but there is no .py in either
>> the withlist command or the function def.

-- 
Mark Sapiro <msapiro at value.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