New question #695864 on mailman in Ubuntu: https://answers.launchpad.net/ubuntu/+source/mailman/+question/695864
Hi, I have been using the withlist command to delete a given administrator or moderator from all mailman 2.1 lists. I also require to change the moderator or admin password for all lists that they have been removed from, but have it so that it is a different randomly generated password for each list they are removed from and then have this emailed to the other moderators or admins who are then left or a default address if none are left (I have managed so far that it is changed to the same password for each list they have been removed from). I am currently at the beginning of my Python learning so this is why I'm asking for help. My script and usage so far can be found below: Usage: withlist --all --run script_name.change_administrator_password [email protected] `pwgen -sB 15 1` The script is saved at: /usr/sbin/ Function defined in the script: import sha def change_administrator_password(mlist, owner, newpasswd): mlist.Lock() try: if mlist.owner[mlist.owner.index(owner)]: mlist.password = sha.new(newpasswd).hexdigest() print (newpasswd) except: print("password not changed for", (mlist.real_name, owner)) mlist.Save() mlist.Unlock() This will go through all lists and change the administrator password to a randomly generated one, but as advised above it will set the same password (not what I want) I've put a print in for debugging so I can see what it was. Thanks Daniel -- You received this question notification because your team Mailman Coders is an answer contact for mailman in Ubuntu. _______________________________________________ Mailman-coders mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/mailman-coders.python.org/ Member address: [email protected]
