
On 5/27/22 10:22, John Lake wrote:
Our security department has asked me to canvas all of our lists (4,237!)—and if a list owner value is not defined they want me to disable the list.
- Can I combine the list_lists and list_owners commands to output both (hopefully linked) values as a .csv?
list_owners -w
will list the owners by list name. If a list has no
owners, only the list name will be output for that list. You could then
process that file to identify the lists with no owners.
- Is there a script that any of you have leveraged to batch disable lists without a defined owner?
What do you mean by disable
?
A withlist script like
def no_owner(mlist)
if len mlist.owner == 0:
if not mlist.Locked:
mlist.Lock
print('List %s has no owners, disabling.' % mlist.real_name)
<code here to disable list. I could provide it if I knew what
that meant>
mlist.Save()
mlist.Unlock()
saved as no_owner.py in Mailman's bin/ directory and run via
bin/withlist -a -r no_owner
You could omit the code
if not mlist.Locked:
mlist.Lock
<code here to disable list. I could provide it if I knew what
that meant>
mlist.Save()
mlist.Unlock()
I.e., just leave the print statement in the if len mlist.owner == 0:
clause to just print the names of lists with no owner.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan