[Mailman-Users] suspending lists from the command line

Mark Sapiro mark at msapiro.net
Mon Apr 2 22:38:08 CEST 2012


turgut kalfaoglu wrote:

>Hi there. During busy times I would like to suspend almost all 
>lists,except some emergency ones.. Is there a way to achieve this from 
>the command line via some script?


What do you mean by suspend? What you need to do depends on the answer
to this. If you mean you want it to appear as if the list doesn't
exist, i.e. mail to the list is undeliverable, the list is not visible
on the web, you could create a shell script to move Mailman's various
lists/LISTNAME/ directories aside and, depending on how mail is
delivered to Mailman, update the necessary things in the MTA. Note
that in some configurations mail is routed programmatically based on
the existance of the lists/LISTNAME/ directory, so simple moving it
aside would be sufficient in those cases.

If on the other hand you mean just set "emergency" moderation for the
lists, consider the following bash script.

#!/bin/bash
cd /to/mailmans/bin/directory
f=mktemp
echo "emergency = True" > $f
for list in `./list_lists --bare`; do
    if [[ "$list" != "emergency_list1" \
         && "$list" != "emergency_list2" \
         && "$list" != "etc" ]]; then
        ./config_list -i $f $list
    fi
done
rm $f


To reverse this, change "emergency = True" to "emergency = False" and
run the script again.

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