[Question #695864]: Change moderator or admin password (random) different for each list they were an admin or moderator for
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 firstname.lastname@domain.co.uk `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.
participants (1)
-
Daniel Botting