Information about config_list and change_pw
Hello all,
Before I go and completely savage the lists we have here, I thought I would try to get a little more information about using config_list.
I get the list information from a file sent to me. I want to use a script to process the file, output the processed data to a file, then use config_list to make the changes to the appropriate list(s). The only values I want to change are the list's owner, moderator, and the *_these_nonmembers.
Can I create a file (properly formatted) to input into config_list containing only the values I want to change? Or, do I have to dump the entire file, make the changes, then reload?
Next, I see the change_pw allows me to change a list's password. Is that the owner's password, the moderator's password, or both? If it is only the owners password, is there a way to change the moderator's password through some other mechanism/program?
Thanks, Chris
Chris Nulk wrote:
Can I create a file (properly formatted) to input into config_list containing only the values I want to change? Or, do I have to dump the entire file, make the changes, then reload?
You can include in the input to config_list only those things you wish to change. Attributes not defined in the config_list input will be unchanged.
Next, I see the change_pw allows me to change a list's password. Is that the owner's password, the moderator's password, or both? If it is only the owners password, is there a way to change the moderator's password through some other mechanism/program?
It's only the list owner/admin password. You can use config_list to change either the admin or moderator password or both.
This three-line input to config_list
from Mailman.Utils import sha_new password = sha_new('abc').hexdigest() mod_password = sha_new('def').hexdigest()
will set the admin password to abc and the moderator poassword to def. When run, it will give this output
Non-standard property restored: password Non-standard property restored: mod_password attribute "sha_new" ignored
That is expected. If you don't want to set both passwords, just omit the corresponding line from the input file.
The lines must be exactly as shown except for the actual passwords.
You can add additional settings in the same input file.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 1/25/2013 6:10 PM, Mark Sapiro wrote:
Chris Nulk wrote:
Can I create a file (properly formatted) to input into config_list containing only the values I want to change? Or, do I have to dump the entire file, make the changes, then reload?
You can include in the input to config_list only those things you wish to change. Attributes not defined in the config_list input will be unchanged.
Next, I see the change_pw allows me to change a list's password. Is that the owner's password, the moderator's password, or both? If it is only the owners password, is there a way to change the moderator's password through some other mechanism/program?
It's only the list owner/admin password. You can use config_list to change either the admin or moderator password or both.
This three-line input to config_list
from Mailman.Utils import sha_new password = sha_new('abc').hexdigest() mod_password = sha_new('def').hexdigest()
will set the admin password to abc and the moderator poassword to def. When run, it will give this output
Non-standard property restored: password Non-standard property restored: mod_password attribute "sha_new" ignored
That is expected. If you don't want to set both passwords, just omit the corresponding line from the input file.
The lines must be exactly as shown except for the actual passwords.
You can add additional settings in the same input file.
Thanks for the information, Mark. While I was waiting for a response from the list, I searched the archives for the discussion about setting/unsetting the moderation bit on list members. I remember there was a discussion and a script to it. I found the discussion (and script) but also saw your website with Mailman scripts. After reviewing the scripts on your site, would it be better to use the various scripts to make changes.
For example, should I use:
- non_members script to make entry changes to the *_these_nonmembers,
- change_admins.py to change the owner/moderator of a list,
- change_pw to change the list owner/moderator password,
- and set_mod.py to change the moderation bit for list members.
I know I will have to do some coding to add the ability to change the moderator password to the change_pw program. I figured I would add a -m/--mod_password option and duplicate the -p option with appropriate corrections.
It seems to make a little more sense to use scripts/programs that are more targeted to specific changes I want to make to a list and I can document what I am doing a little easier.
Thanks for the information and any advice, Chris
Chris Nulk wrote:
It seems to make a little more sense to use scripts/programs that are more targeted to specific changes I want to make to a list and I can document what I am doing a little easier.
If you know what you are doing, you can do anything to a list with config_list or withlist. These are powerful tools that also have the ability to break things badly if you don't know what you're doing or make a mistake.
A targeted script is more limited in what it can do, but if it is well tested, probably won't break anything in an irrecoverable way.
Most of the scripts in my scripts/ directory were created in response to "how do I" questions on this list that I thought were of some wider interest. They exist so I can point people at them rather than explaining how to do it each time it comes up. Others are things I actually use myself.
Ultimately, its a matter of taste, style and frequency of use that determines the choice of a targeted script vs. a more general tool to accomplish a specific task.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 1/28/2013 10:53 AM, Mark Sapiro wrote:
Chris Nulk wrote:
It seems to make a little more sense to use scripts/programs that are more targeted to specific changes I want to make to a list and I can document what I am doing a little easier.
If you know what you are doing, you can do anything to a list with config_list or withlist. These are powerful tools that also have the ability to break things badly if you don't know what you're doing or make a mistake.
A targeted script is more limited in what it can do, but if it is well tested, probably won't break anything in an irrecoverable way.
Most of the scripts in my scripts/ directory were created in response to "how do I" questions on this list that I thought were of some wider interest. They exist so I can point people at them rather than explaining how to do it each time it comes up. Others are things I actually use myself.
Ultimately, its a matter of taste, style and frequency of use that determines the choice of a targeted script vs. a more general tool to accomplish a specific task.
Great information, Mark. I appreciate your time and knowledge for replying.
I agree both config_list and withlist have a lot of power. I think using the targeted scripts will work better for me since they are more limited. I also appreciate you having created some very useful scripts for others to use.
Thanks again, Chris
participants (2)
-
Chris Nulk
-
Mark Sapiro