Changing parameters for one [or many] users from the command line
I'd like to change several of the parameters [digest, nomail, etc] for a bunch of users on one of my lists. I've looked through the list of commands in /bin and I don't see a way to modify the parameter settings from the command line [and it'll be real tedious to do it one at a time from the admin interface]. Is there a way to do it?
Thanks! /bernie\
-- Bernie Cosell Fantasy Farm Fibers mailto:bernie@fantasyfarm.com Pearisburg, VA --> Too many people, too few sheep <--
On 05/21/2014 06:11 PM, Bernie Cosell wrote:
I'd like to change several of the parameters [digest, nomail, etc] for a bunch of users on one of my lists. I've looked through the list of commands in /bin and I don't see a way to modify the parameter settings from the command line [and it'll be real tedious to do it one at a time from the admin interface]. Is there a way to do it?
Assuming you want to set the same settings for all members, it's easy via withlist, See for example the script at <http://www.msapiro.net/scripts/set_nodups.py>. This sets all members of a list to "nodups". If you wanted to set all members to receive dups, you would change the line
mlist.setMemberOption(member, mm_cfg.DontReceiveDuplicates, 1)
to
mlist.setMemberOption(member, mm_cfg.DontReceiveDuplicates, 0)
If you wanted to set all members to not receive dups, not receive their own posts and receive acknowledgement of their posts, you would leave the one line as in the original and add two more as follows:
mlist.setMemberOption(member, mm_cfg.DontReceiveDuplicates, 1)
mlist.setMemberOption(member, mm_cfg.DontReceiveOwnPosts, 1)
mlist.setMemberOption(member, mm_cfg.AcknowledgePosts, 1)
See the section "Bitfield for user options" in Mailman/Defaults.py for the symbolic names of the options as used above.
Note that the comment in that section about Digests not needing a bit flag doesn't imply you don't (re)set it this way. You'd still use
mlist.setMemberOption(member, mm_cfg.Digests, 1)
to set members to digest and
mlist.setMemberOption(member, mm_cfg.Digests, 0)
to set them to messages, but also see <http://www.msapiro.net/scripts/set_nodigest.py>
Also, nomail is handled differently. Here you'd need
from Mailman import MemberAdaptor
at the beginning of your script and
mlist.setDeliveryStatus(member, MemberAdaptor.BYADMIN)
to set nomail by admin. There's a script at <http://www.msapiro.net/scripts/set_nomail.py> that sets nomail, but it probably has more options than you need.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 21 May 2014 at 20:03, Mark Sapiro wrote:
On 05/21/2014 06:11 PM, Bernie Cosell wrote:
I'd like to change several of the parameters [digest, nomail, etc] for a bunch of users on one of my lists. I've looked through the list of commands in /bin and I don't see a way to modify the parameter settings from the command line [and it'll be real tedious to do it one at a time from the admin interface]. Is there a way to do it?
Assuming you want to set the same settings for all members, it's easy via withlist,
Alas, I only need to mess with 80 out of 400. BUT in this case setting them *all* to "mail" [i.e., not-nomail] would be OK, so I'll look at withlist...
Also, nomail is handled differently. Here you'd need
from Mailman import MemberAdaptor
at the beginning of your script and
mlist.setDeliveryStatus(member, MemberAdaptor.BYADMIN)
to set nomail by admin. There's a script at <http://www.msapiro.net/scripts/set_nomail.py> that sets nomail, but it probably has more options than you need.
How would you clear nomail? Because that looks OK if it does just one member. I can easily whip up a shell script to generate the .py file with the commands for the 80 members I need to tweak.
Thanks! /b\
-- Bernie Cosell Fantasy Farm Fibers mailto:bernie@fantasyfarm.com Pearisburg, VA --> Too many people, too few sheep <--
On 05/22/2014 07:34 AM, Bernie Cosell wrote:
On 21 May 2014 at 20:03, Mark Sapiro wrote:
Alas, I only need to mess with 80 out of 400. BUT in this case setting them *all* to "mail" [i.e., not-nomail] would be OK, so I'll look at withlist...
You might also look at Mailman's bin/list-members --nomail= command to list the members you're interested in.
Also, nomail is handled differently. Here you'd need
from Mailman import MemberAdaptor
at the beginning of your script and
mlist.setDeliveryStatus(member, MemberAdaptor.BYADMIN)
to set nomail by admin. There's a script at <http://www.msapiro.net/scripts/set_nomail.py> that sets nomail, but it probably has more options than you need.
How would you clear nomail?
mlist.setDeliveryStatus(member, MemberAdaptor.ENABLED)
Because that looks OK if it does just one member. I can easily whip up a shell script to generate the .py file with the commands for the 80 members I need to tweak.
Also, see the script at <http://www.msapiro.net/scripts/reset_bounce.py>. I could be more specific with my advice if I knew exactly what you want to do.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Bernie Cosell
-
Mark Sapiro