On 05/30/2013 11:37 AM, Seun Ojedeji wrote:
> Hello,
> 
> I was wondering, is there a way i could discard all pending moderation
> messages and also simultaneously add the sender's address to discard for
> subsequent mails?


If there aren't too many, it should be easy enough to go to the admindb
interface for the list and for each sender in the summary of held
messages, check the "Add xxx to one of these sender filters:" box and
select the 'Discards' radio button and finally check the 'Discard all
messages marked Defer' box and submit changes.

If there are so many that this is unwieldy, you could do this with a
withlist script. Something along the lines of the following totally
untested script:

from Mailman import mm_cfg
def discard(mlist):
    for id in mlist.GetHeldMessageIds():
        sender = mlist.GetRecord(id)[1]
        if sender not in mlist.discard_these_nonmembers:
            mlist.discard_these_nonmembers.append(sender)
        mlist.HandleRequest(id, mm_cfg.DISCARD)


See 'bin/withlist --help' for what to do with this.

-- 
Mark Sapiro <m...@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to