1

Is there a way to change the moderation flag of a member of a list from the command line, with Mailman?

2 Answers 2

1

There is a python script at http://www.msapiro.net/scripts/set_mod.py that might do what you need. I'm not aware of anything that actually comes with mailman to do this.

3

Turn ON moderated bit:

/usr/lib/mailman/bin/withlist -r mod.set $currentlist $user 1

Turn OFF moderated bit:

/usr/lib/mailman/bin/withlist -r mod.set $currentlist $user 0

In the above 2 statements, replace $currentlist with the list name and $user with the member's subscribed address.

Using "mod.py":

#! /usr/bin/python
# mod.py

from Mailman import mm_cfg
import sys

def mod(list):
    for member in list.getMembers():
        if list.getMemberOption(member, mm_cfg.Moderate):
            print member, "is moderated"

def set(list, member, value):
    value = not not (int(value))
    if list.isMember(member):
        list.Lock()
        list.setMemberOption(member, mm_cfg.Moderate, value)
        print "%s's moderated flag set to %d" % (member, value)
        list.Save()
        list.Unlock()
    else:
        print member, "not a member"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .