Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2008-05-27 13:24:20
Size: 2710
Editor: terri
Comment:
Revision 4 as of 2015-01-31 02:36:58
Size: 2330
Editor: msapiro
Comment: Removed FAQ Wizard last edited
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/4030546
Line 3: Line 3:
Line 15: Line 16:
======================================
{{{
Line 21: Line 21:
{{{
Line 23: Line 22:
}}}         mlist.setMemberPassword(addr, newpasswd)
        mlist.Save()
Line 25: Line 25:

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


{{{
        mlist.Save()
}}}


{{{
Line 38: Line 26:
}}}


{{{
Line 44: Line 28:

========================================
Line 51: Line 33:
========================================
{{{
Line 55: Line 36:
if [[../$# -ne 2|$# -ne 2]]; then if [ $# -ne 2 ]; then
Line 57: Line 38:
{{{
Line 59: Line 39:
}}}


{{{
Line 64: Line 40:
}}}
Line 67: Line 41:

{{{
Line 70: Line 42:
}}}


{{{
Line 75: Line 43:
}}}
Line 88: Line 54:

{{{
Line 91: Line 55:
}}}


{{{
Line 96: Line 56:
}}}
Line 102: Line 61:
======================================= }}}
Line 108: Line 67:
{{{
Line 109: Line 69:
}}}
Line 110: Line 71:
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 73:
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 75:
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 84:
}}}
Line 136: Line 88:
{{{
Line 137: Line 90:
}}}
Line 138: Line 92:
and so on through all of your subscribers for that list. If all and so on through all of your subscribers for that list. If all of the passwords are "foobar" then things worked.
Line 140: Line 94:
of the passwords are "foobar" then things worked. Converted from the Mailman FAQ Wizard
Line 142: Line 96:
''Last changed on Mon Jan 6 20:25:24 2003 by'' Jeff Earickson
<<Color2(Converted from the Mailman FAQ Wizard, col=darkgreen)>>
This is one of many [[../Frequently Asked Questions|Frequently Asked Questions]].
This is one of many [[../Frequently Asked Questions|Frequently Asked Questions]].

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 &gt; /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 &gt; /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.

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)