Attached is a script that i wrote a week or two ago to do exactly that.
you might need to edit the top line to reflect the location of python on
your system. I had the script sitting in ~mailman/bin on my system and it
worked quite happily.

If you want to run it in cron, schedule it to run just before mailman sends
out administrative reminders to the moderator/owner of the list. That way
there is little chance of the moderators getting mails about pending requests.

Regards

Donal

On Tue, 08 May 2001 21:06:36 +0900
ISO-2022-JP <ISO-2022-JP> wrote:
> > Is there any way to manually process the pending request from
> > command line?
>
> Delete the relevant files from ~mailman/data/
>
> --
> J C Lawrence [EMAIL PROTECTED]
> ---------(*) http://www.kanga.nu/~claw/
> The pressure to survive and rhetoric may make strange bedfellows
>
> ---------------------------------------------------------------




#! /usr/local/bin/python 
#
# Written by Donal Hunt
# April 23rd 2001
#
# argv[1] should be the name of the list.

"""Clear pending administrative requests for a list

Usage:
    clear_requests listname

Where:

    listname
        The name of the Mailman list you want to clear 
        pending requests from.  It must already exist.

"""

import sys
import os
import string
import getopt
import paths
from Mailman import mm_cfg
from Mailman import Utils
from Mailman import MailList
from Mailman import Errors
from Mailman import Message
from Mailman.Logging.Syslog import syslog


def usage(status, msg=''):
    if msg:
        print msg
    print __doc__ % globals()
    sys.exit(status)



def main():
    try:
        ml = MailList.MailList(sys.argv[1])
    except Errors.MMListError, e:
        usage(1, 'No such list: %s (%s)' % (listname, e))
    try:
        print 'No of Requests Pending: %s ' % ml.NumRequestsPending()
        print 'No of postings awaiting approval: %s ' % ml.GetHeldMessageIds()
        print 'No of subsciptions awaiting approval: %s ' % ml.GetSubscriptionIds()
        for i in ml.GetHeldMessageIds():
            ml.HandleRequest(i, 3)
        for i in ml.GetSubscriptionIds():
            ml.HandleRequest(i, 2, 'No subscription allowed - please mail %s' % 
ml.owner[0] )

        print 'No of Requests Pending: %s ' % ml.NumRequestsPending()
        ml.Save()
    finally:
        ml.Unlock()

main()

Reply via email to