Removing moderation flag via the command line

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello,
I'm trying to remove the moderator flag on some users via the command line so that these users are allowed to post to lists where the moderator flag is set by default. I found this posting from Feb. 2005, but this doesn't appear to be working for me:
http://mail.python.org/pipermail/mailman-users/2005-February/042396.html
My script in the Mailman base directory:
# DU mailman Modules # This should live in the base Mailman install directory to be seen by the withlist Mailman binary.
from Mailman import mm_cfg from Mailman.Errors import NotAMemberError
# Set a member's moderator flag to on or off # e.g. to disable moderation: setMemberModeratedFlag listname, email_address, '' def setMemberModeratedFlag (mlist, addr, mod): #print "Setting moderator flag to ",mod," for ",addr mlist.setMemberOption (addr, mm_cfg.Moderate, mod) mlist.Save()
My input:
# withlist -l -r du.setMemberModeratedFlag testlist myemailaddress '' Importing du... Running du.setMemberModeratedFlag()... Loading list testlist (locked) Unlocking (but not saving) list: testlist Finalizing
(I also tried replacing the double quotes with "off"). This does not actually remove the flag for this address - posting to the list by this address still gets a bounce back saying that moderator approval is required.
Any ideas?
Joe Auty NetMusician: web publishing software for musicians http://www.netmusician.org joe@netmusician.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJUIlmCgdfeCwsL5ERAluCAJ47WJ/VqizlT/IhZw1M1wQkwEOYYQCdHC7I E2rRQqJpGWP5jZHSVdPfvoU= =20IC -----END PGP SIGNATURE-----

Joe Auty wrote:
I'm trying to remove the moderator flag on some users via the command line so that these users are allowed to post to lists where the moderator flag is set by default. I found this posting from Feb. 2005, but this doesn't appear to be working for me:
http://mail.python.org/pipermail/mailman-users/2005-February/042396.html
My script in the Mailman base directory:
# DU mailman Modules # This should live in the base Mailman install directory to be seen by the withlist Mailman binary.
from Mailman import mm_cfg from Mailman.Errors import NotAMemberError
# Set a member's moderator flag to on or off # e.g. to disable moderation: setMemberModeratedFlag listname, email_address, '' def setMemberModeratedFlag (mlist, addr, mod): #print "Setting moderator flag to ",mod," for ",addr mlist.setMemberOption (addr, mm_cfg.Moderate, mod) mlist.Save()
My input:
# withlist -l -r du.setMemberModeratedFlag testlist myemailaddress '' Importing du... Running du.setMemberModeratedFlag()... Loading list testlist (locked) Unlocking (but not saving) list: testlist Finalizing
I don't know why this doesn't work. It works for me.
(I also tried replacing the double quotes with "off").
That will definetly not work. That will pass the string "off" as the value of mod in the mlist.setMemberOption (addr, mm_cfg.Moderate, mod) call, and setMemberOption tests the Python truth of this value. Since "off" is a non-zero length string, it is True so the option will be set On. The null string is the only argument that can be passed to this script which has value False.
This does not actually remove the flag for this address - posting to the list by this address still gets a bounce back saying that moderator approval is required.
Any ideas?
See the script at <http://www.msapiro.net/scripts/set_mod.py> which is more robust and may work better for you.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro wrote:
Joe Auty wrote: <snip>
This does not actually remove the flag for this address - posting to the list by this address still gets a bounce back saying that moderator approval is required.
What is the reason why the post is held? Is it "Post by moderated member" or some other reason?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro wrote:
Mark Sapiro wrote:
Joe Auty wrote: <snip>
This does not actually remove the flag for this address - posting to the list by this address still gets a bounce back saying that moderator approval is required.
What is the reason why the post is held? Is it "Post by moderated member" or some other reason?
"Post to moderated list"
Does this change the advice you gave me? Sorry, I'm a little confused sorting out the distinction between moderators, the moderator flag, a moderated list, etc. Was my original description of my problem (wanting to remove the moderator flag) accurate in terms of the problem I'm trying to solve? I've been wondering if what I've been actually accomplishing in my command is just allowing people the ability to moderate other content - approving held messages. Are people that can do this moderators, and is the moderator flag used for defining who is a moderator, or who can post to a moderated list?
I simply want to accomplish the CLI equivalent of unchecking the "mod" checkbox in the membership list within the web interface.
-- Joe Auty NetMusician: web publishing software for musicians http://www.netmusician.org joe@netmusician.org

Joe Auty wrote:
Mark Sapiro wrote:
Mark Sapiro wrote:
What is the reason why the post is held? Is it "Post by moderated member" or some other reason?
"Post to moderated list"
Does this change the advice you gave me?
No. I was just trying to determine if the script was actually failing to clear the "moderate" flag. Since the only evidence you gave for its failure was that posts were still being held, I wanted to be sure that they were being held because of the "moderate" flag.
Sorry, I'm a little confused sorting out the distinction between moderators, the moderator flag, a moderated list, etc. Was my original description of my problem (wanting to remove the moderator flag) accurate in terms of the problem I'm trying to solve?
Yes, I think so.
I've been wondering if what I've been actually accomplishing in my command is just allowing people the ability to moderate other content - approving held messages. Are people that can do this moderators, and is the moderator flag used for defining who is a moderator, or who can post to a moderated list?
The flag determines whether this person's post will be held for moderation for this reason. There are other reasons why a post might be held for moderator approval. For example, "too big", "implicit destination", "too many recipients", "post from a non-member", etc., but if a member's "moderate" flag is set, that person's posts will be held with reason "Post to moderated list".
The "moderate" flag which is the same as the "mod" check box in the web admin Membership List is this control, and it has nothing to do with who is a moderator. List admins and moderators are in fact people who know the respective passwords. There are lists of addresses for "owner" and "moderator", but they actually only control who receives notices and what addresses appear in the "list run by" field at the bottom of web pages.
I simply want to accomplish the CLI equivalent of unchecking the "mod" checkbox in the membership list within the web interface.
That's what the script is supposed to do. As I said in my prior post, I don't know why it apparently isn't working. I copied the script out of your OP (and removed the '> ' from each line) and ran it with the withlist command in your post changing only the list name and user address and I could set a user's mod flag with
withlist -l -r du.setMemberModeratedFlag testlist myemailaddress 'x'
and clear it with
withlist -l -r du.setMemberModeratedFlag testlist myemailaddress ''
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Joe Auty
-
Mark Sapiro