2411
Comment: Assorted formatting fixes
|
← Revision 5 as of 2015-02-08 11:23:31 ⇥
2322
wikification
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
#pragma page-filename DOC/versions/14352511 | #pragma page-filename DOC/versions/4030546 |
Line 3: | Line 3: |
This scripting trick works for 2.x versions of Mailman, and | |
Line 5: | Line 4: |
relies on bin/withlist to work. | This scripting trick works for 2.x versions of Mailman, and relies on bin/withlist to work. |
Line 7: | Line 6: |
1) Become the "mailman" user, eg "su - mailman". | 1) Become the "mailman" user, eg `su - mailman`. |
Line 10: | Line 9: |
Line 12: | Line 10: |
Line 29: | Line 26: |
and make it executable (chmod 700 change.userpw): |
and make it executable (`chmod 700 change.userpw`): |
Line 59: | Line 55: |
Line 61: | Line 58: |
4) Run the shell script to change all subscriber passwords in a specified list, eg: |
4) Run the shell script to change all subscriber passwords in a specified list, eg: |
Line 71: | Line 66: |
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: | 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 74: | Line 69: |
Line 91: | Line 87: |
''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]]. |
Converted from the Mailman FAQ Wizard 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 > /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.
Converted from the Mailman FAQ Wizard
This is one of many Frequently Asked Questions.