[Mailman-Users] list member email address format issues

Scott scott at chronis.pobox.com
Wed Nov 11 23:58:57 CET 1998


we just had the same problem here.  It looks like convert_list and
what not need to be a little more robust about what exactly gets
added. 

In order to change the subscriptions, you have to either write a
script, or interact with the list manually to fix this without
unsubscribing/resusbscribing everyone.  This could be a pain.  Another
alternative is to delete the list then re run convert_list or whatever
you ran originally with just the names and nothing else.

I've attached a script that should fix all such addresses, just put it
in your $prefix/bin directory, chmod it, and run it.

Please note the printed output to make sure that it does exactly what
you want.

scott


On Wed, Nov 11, 1998 at 05:40:50PM -0500, John Lewis wrote:
| Greetings, 
| 
| I am running mailman 1.0b6 on a redhat 5.2 intel box.
| 
| I added several members to a mailing list using the following format:
| 
| John Doe <john.doe at anon.com>
| 
| Which appears to work in regard to sending out mail etc, 
| 
| However, it upsets the html parsing of the membership configuration page in
| the administration settings.  The brackets around the email address wreak
| havoc with the checkboxes for the user options.
| 
| Perhaps this needs to be stated in the instructions for adding new users...
|  just add their email addresses, not names etc.
| 
| Which gets me to: Is there a way I can edit the current subscribers to
| remove the above syntax and replace it with just their email addresses
| without having to unsubscribe them then resubscribe?  Is there a text file
| of subscribers that I can edit?
| 
| Thanks.
| 
| -John Lewis
| 
| ------------------------------------------------------
| Mailman-Users maillist  -  Mailman-Users at python.org
| http://www.python.org/mailman/listinfo/mailman-users
| 
-------------- next part --------------
#!/usr/bin/env python

import re
import sys

import paths

from Mailman.Utils import map_maillists, list_names
from Mailman.MailList import MailList


def log(msg, *args):
    if not args:
        sys.stderr.write(msg + "\n")
        return
    t = tuple(args)
    msg = msg % t
    sys.stderr.write(msg + "\n")

#
# an re for almost all emails (with FQHN) and that
# will get rid of most errors.
#
valid_email = re.compile(r"[^<> \t,]+@[^<> \t,]+").search


def fix_addrs(addr_list):
    res = []
    for a in addr_list:
        m = valid_email(a)
        if not m:
            log("\t%s doesn't look like a valid address!", a)
            continue
        if m.group(0) != a:
	    log("\treplacing %s with %s", a, m.group(0))
            res.append(m.group(0))
        else:
            res.append(a)
    return res

for listname in list_names():
    l = MailList(listname)
    print "looking addresses for", listname
    l.members = fix_addrs(l.members)
    l.digest_members = fix_addrs(l.digest_members)
    l.Save()

            


More information about the Mailman-Users mailing list