[Mailman-Users] Bulk update of list member names?

Mark Sapiro mark at msapiro.net
Wed Oct 8 05:04:53 CEST 2008


bjames at cisco.com wrote:

>If one has an existing mailing list with just email addresses,
>is there any procedure available to bulk-update the list membership
>with the subscribers' names (short of unsubscribing and re-subscribing
>the list members)?
>
>The "set" email command does not appear to have an option to
>change the name field.
>
>I'm looking for a procedure that does not require shell access on
>the list sever, if possible.


The following script based on
<http://starship.python.net/crew/jwt/mailman/unhide.py> will read a
file (subscribers.txt) of list members, one per line, in the form

Real Name <rn at example.com>
"R. Name" <rn at example.net>
etc.

parse it into name and address and update the real name for address to
name. It requires python on your work station and the obvious changes
for listname, options_url and password.

---------------------------------------------------
#!/usr/bin/env python
import email
import urllib

listname = 'mylist'
options_url = 'http://www.example.com/mailman/options/'
password = 'listpassword'

subscribers = open('subscribers.txt', 'rt')
                                                                       
        

for subscriber in subscribers:
    name, addr = email.Utils.parseaddr(subscriber)
    if name and addr:
        params = urllib.urlencode({'password':password,
                                   'fullname':name,
                                   'change-of-address':1})
        u = urllib.urlopen('%s%s/%s' %
                           (options_url, listname, urllib.quote(addr)),
                           params)
        u.close()
---------------------------------------------------

You could also do the same thing with, for example, a shell script and
wget. This URL will change the real name for user at example.com to Real
Name:

http://www.example.com/mailman/options/mylist/user%40example.com?password=listpassword&fullname=Real%20Name&change-of-address=1

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list