I have the php page to do this.

I have two drop down lists. One shows all the email addresses of people on all the lists. So a user can view what lists he/she is on and then the other drop down is the list of lists. Select the mailing list you want and it shows what email addresses are on the list. I also have the number of list users labeled in the drop down. It will require you to install php but other than that, it will work. I run a cron every 5 minutes so that the list is always updated. Or you can run the script the cron runs every time the page is accessed (you would need to change the page and uncomment the line:
" // `/usr/lib/mailman/bin/find_member_html ^.* > /srv/www/htdocs/lists.txt`; " .




Attached is the script the cron runs, the cron, the script to list users and lists and the php page. Let me know if you have any trouble.

I put update_list.sh and find_member_html in /usr/lib/mailman/bin/ and the mailman_lists2468.php page in /srv/www/(some created directory) . You will need to edit your httpd.conf file for this directory to be viewable.

The script runs the /usr/lib/mailman/bin/list_lists command and outputs the lists and email addresses to a text file. The php page parses the text file and makes it searchable.

I am also working on an easier admin page for mailman. I modified the newlist script to have more secure defaults when creating a list and the new admin page has a text field to enter one or many email addresses. A drop down lists all current email addresses subscribed to all lists or a drop down that lists all lists. Selecting a user brings up all the lists available and a check box next to each with subscribe/unsubscribe (if already subscribed then the subscribe box is grayed out and same with if they are not a member then the unsubscribe is grayed out.)

There is a text field to put the name of a new list and it already has the default listadmin, etc. (which you can change).


[EMAIL PROTECTED] wrote:


I'm seeking a page where the number of active subscribers are shown next to the list name.

In a message dated 11/17/03 8:15:05 PM, [EMAIL PROTECTED] writes:

<< I have over 300 mailing lists and need a way to view a snapshot of each

list on one page.


I know I can go to https://mail.domain.com/mailman/private/listname to


see archive stats for each list but has anyone thought of a way to view

them all on one page to see what list is getting used and what one is

not? Best scenario, graphical representation.


Second best scenario,


An html formatted page listing each list in a table with the

corresponding month next to it along with archive size or better yet, #

of messages in each archive for the months listed.


I would be willing to help anyone write this via php if anyone else sees


a need for this. >>



# At 8AM every day, mail reminders to admins as to pending requests.
# They are less likely to ignore these reminders if they're mailed
# early in the morning, but of course, this is local time... ;)
0 8 * * * /usr/bin/python -S /usr/lib/mailman/cron/checkdbs
#
# At 9AM, send notifications to disabled members that are due to be
# reminded to re-enable their accounts.
0 9 * * * /usr/bin/python -S /usr/lib/mailman/cron/disabled
#
# Noon, mail digests for lists that do periodic as well as threshhold delivery.
0 12 * * * /usr/bin/python -S /usr/lib/mailman/cron/senddigests
#
# 5 AM on the first of each month, mail out password reminders.
0 5 1 * * /usr/bin/python -S /usr/lib/mailman/cron/mailpasswds
#
# Every 5 mins, try to gate news to mail.  You can comment this one out
# if you don't want to allow gating, or don't have any going on right now,
# or want to exclusively use a callback strategy instead of polling.
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/python -S 
/usr/lib/mailman/cron/gate_news
#
# At 3:27am every night, regenerate the gzip'd archive file.  Only
# turn this on if the internal archiver is used and
# GZIP_ARCHIVE_TXT_FILES is false in mm_cfg.py
27 3 * * * /usr/bin/python -S /usr/lib/mailman/cron/nightly_gzip
# Cron to generate the list of mailing lists
*/5 * * * * /usr/lib/mailman/bin/update_list.sh
#! /usr/bin/python
#
# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

"""Find all lists that a member's address is on.

Usage:
    find_member [options] regex [regex [...]]

Where:
    --listname=listname
    -l listname
        Include only the named list in the search.

    --exclude=listname
    -x listname
        Exclude the named list from the search.

    --owners
    -w
        Search list owners as well as members.

    --help
    -h
        Print this help message and exit.

    regex
        A Python regular expression to match against.

The interaction between -l and -x is as follows.  If any -l option is given
then only the named list will be included in the search.  If any -x option is
given but no -l option is given, then all lists will be search except those
specifically excluded.

Regular expression syntax is Perl5-like, using the Python re module.  Complete
specifications are at:

http://www.python.org/doc/current/lib/module-re.html

Address matches are case-insensitive, but case-preserved addresses are
displayed.

"""

import sys
import re
import getopt

import paths
from Mailman import Utils
from Mailman import MailList
from Mailman import Errors
from Mailman.i18n import _

AS_MEMBER = 0x01
AS_OWNER = 0x02



def usage(code, msg=''):
    if code:
        fd = sys.stderr
    else:
        fd = sys.stdout
    print >> fd, _(__doc__)
    if msg:
        print >> fd, msg
    sys.exit(code)



def scanlists(options):
    cres = []
    for r in options.regexps:
        cres.append(re.compile(r, re.IGNORECASE))
    #
    # dictionary of {address, (listname, ownerp)}
    matches = {}
    for listname in options.listnames:
        try:
            mlist = MailList.MailList(listname, lock=0)
        except Errors.MMListError:
            print _('No such list: %(listname)s')
            continue
        if options.owners:
            owners = mlist.owner
        else:
            owners = []
        for cre in cres:
            for member in mlist.getMembers():
                if cre.search(member):
                    addr = mlist.getMemberCPAddress(member)
                    entries = matches.get(addr, {})
                    aswhat = entries.get(listname, 0)
                    aswhat |=  AS_MEMBER
                    entries[listname] = aswhat
                    matches[addr] = entries
            for owner in owners:
                if cre.search(owner):
                    entries = matches.get(addr, {})
                    aswhat = entries.get(listname, 0)
                    aswhat |= AS_OWNER
                    entries[listname] = aswhat
                    matches[addr] = entries
    return matches



class Options:
    listnames = Utils.list_names()
    owners = None


def main():
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'l:x:wh',
                                   ['listname=', 'exclude=', 'owners',
                                    'help'])
    except getopt.error, msg:
        usage(1, msg)

    options = Options()
    loptseen = 0
    excludes = []
    for opt, arg in opts:
        if opt in ('-h', '--help'):
            usage(0)
        elif opt in ('-l', '--listname'):
            if not loptseen:
                options.listnames = []
                loptseen = 1
            options.listnames.append(arg.lower())
        elif opt in ('-x', '--exclude'):
            excludes.append(arg.lower())
        elif opt in ('-w', '--owners'):
            options.owners = 1

    for ex in excludes:
        try:
            options.listnames.remove(ex)
        except ValueError:
            pass

    if not args:
        usage(1, _('Search regular expression required'))

    options.regexps = args

    if not options.listnames:
        print _('No lists to search')
        return

    matches = scanlists(options)
    addrs = matches.keys()
    addrs.sort()
    for k in addrs:
        hits = matches[k]
        lists = hits.keys()
        print k, _('found in:')
        for name in lists:
            aswhat = hits[name]
            if aswhat & AS_MEMBER:
                print '    ', name
            if aswhat & AS_OWNER:
                print '    ', name, _('(List Owner)')



if __name__ == '__main__':
    main()
------------------------------------------------------
Mailman-Users mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/

This message was sent to: [EMAIL PROTECTED]
Unsubscribe or change your options at
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to