Mark Sapiro wrote:
> 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.
It occurred to me that there is a problem with the above, namely it
doesn't save the list so it will probably discard all the held messages
but not update discard_these_nonmembers.
The following is still untested, but should be better
from Mailman import mm_cfg
def discard(mlist):
if not mlist.Locked():
mlist.Lock()
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)
mlist.Save()
mlist.Unlock()
--
Mark Sapiro <[email protected]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list [email protected]
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