Differences between revisions 1 and 2
Revision 1 as of 2008-05-27 13:24:20
Size: 2710
Editor: terri
Comment:
Revision 2 as of 2008-05-30 14:30:05
Size: 2411
Editor: terri
Comment: Assorted formatting fixes
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma page-filename DOC/versions/4292612 #pragma page-filename DOC/versions/14352511
Line 15: Line 15:
======================================
{{{
Line 21: Line 20:
{{{
Line 23: Line 21:
}}}         mlist.setMemberPassword(addr, newpasswd)
        mlist.Save()
Line 25: Line 24:

{{{
        mlist.setMemberPassword(addr, newpasswd)
}}}


{{{
        mlist.Save()
}}}


{{{
Line 38: Line 25:
}}}


{{{
Line 44: Line 27:

========================================
Line 51: Line 32:
========================================
{{{
Line 55: Line 35:
if [[../$# -ne 2|$# -ne 2]]; then if [ $# -ne 2 ]; then
Line 57: Line 37:
{{{
Line 59: Line 38:
}}}


{{{
Line 64: Line 39:
}}}
Line 67: Line 40:

{{{
Line 70: Line 41:
}}}


{{{
Line 75: Line 42:
}}}
Line 88: Line 53:

{{{
Line 91: Line 54:
}}}


{{{
Line 96: Line 55:
}}}
Line 101: Line 59:

=======================================
}}}
Line 108: Line 65:
{{{
Line 109: Line 67:
}}}
Line 110: Line 69:
will change the password for all subscribers in list "mylist" will change the password for all subscribers in list "mylist" to foobar.
Line 112: Line 71:
to foobar. 5) Check your work and check the status of the database files for the list. You should do a "check_db mylist" to see if you get any complaints (you should not). You should also do a dumpdb on the list's database file and take a look at it. You will find that all subscriber passwords in the database are what you specified for the shell script (if things worked). For example:
Line 114: Line 73:
5) Check your work and check the status of the database files

for the list. You should do a "check_db mylist" to see if you

get any complaints (you should not). You should also do a dumpdb

on the list's database file and take a look at it. You will find

that all subscriber passwords in the database are what you

specified for the shell script (if things worked). For example:
{{{
Line 133: Line 81:
}}}
Line 136: Line 85:
{{{
Line 137: Line 87:
}}}
Line 138: Line 89:
and so on through all of your subscribers for that list. If all

of the passwords are "foobar" then things worked.
and so on through all of your subscribers for that list. If all of the passwords are "foobar" then things worked.

3.16. How do I assign a single password to all subscribers in a list?

This scripting trick works for 2.x versions of Mailman, and

relies on bin/withlist to work.

1) Become the "mailman" user, eg "su - mailman".

2) Put the following small file "changeuserpw.py" in the bin subdirectory, making

sure that ~/bin is in user mailman's default path, so the file

can be found and used:

from Mailman.Errors import NotAMemberError

def changeuserpw(mlist, addr, newpasswd):

    try:
        mlist.setMemberPassword(addr, newpasswd)
        mlist.Save()

    except NotAMemberError:
        print 'No address matched:', addr

3) Create the following small shell script, named "change.userpw"

and make it executable (chmod 700 change.userpw):

if [ $# -ne 2 ]; then

        print "Usage is: $0 list password"
        exit 1
else
        list=$1
        passwd=$2
fi

#---get the list members

list_members $list > /tmp/$list.members

#---change the user passwords

for member in `cat /tmp/$list.members`

do
        print "==== $member"
        withlist -l -r changeuserpw $list $member $passwd

done

rm /tmp/$list.members

4) Run the shell script to change all subscriber passwords

in a specified list, eg:

change.userpw mylist foobar

will change the password for all subscribers in list "mylist" to foobar.

5) Check your work and check the status of the database files for the list. You should do a "check_db mylist" to see if you get any complaints (you should not). You should also do a dumpdb on the list's database file and take a look at it. You will find that all subscriber passwords in the database are what you specified for the shell script (if things worked). For example:

cd /web/data/mailman/lists/mylist

ls -l config.*

dumpdb config.pck > /tmp/mylist.dump

vi /tmp/mylist.dump

And then look for something like:

'passwords': { 'joeblow@somewhere.com': 'foobar',

and so on through all of your subscribers for that list. If all of the passwords are "foobar" then things worked.

Last changed on Mon Jan 6 20:25:24 2003 by Jeff Earickson Converted from the Mailman FAQ Wizard

This is one of many Frequently Asked Questions.

MailmanWiki: DOC/How do I assign a single password to all subscribers in a list? (last edited 2015-02-08 11:23:31 by JimTittsler)