
On 5/27/22 12:47, Bruce Johnson via Mailman-Users wrote:
Well some guy named Mark supported one method in the past 8-) (which I found googling ‘how to disable a mailman 2 list’ because I’d like to know how, too, since we do occasionally have need to do this.)
https://mail.python.org/pipermail/mailman-users/2010-September/070283.html
The method in that thread is simply moving the lists/<listname> aside. That is one way to disable a list, but there are others depending on what you actually want. For that, this withlist script will do it.
import os
from Mailman import Site
BACKUP_DIR = 'path to a mailman writable directory'
def no_owner(mlist)
if len mlist.owner == 0:
print('List %s has no owners, disabling.' % mlist.real_name)
src = Site.get_listpath(mlist.internal_name())
dst = os.path.join(BACKUP_DIR, mlist.internal_name())
os.rename(src, dst)
BACKUP_DIR is set to the full path of the directory in which to save the list configurations. To avoid potential issues with os.rename, BACKUP_DIR should be on the same file system as Mailman's lists/ directory.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan