[Mailman-Users] Batch member attributes

2006-05-22 Thread Benjamin Roger
Hello everyone,

I am somewhat desperate - I need a few people to be able to post on 
about 80 lists (cascaded) here, without moderation (moderation being the 
default setting for members).
I think that to achieve this, I need to add them as members - and then 
change their attributes, so they're not moderated, and do *not* receive 
mails (80 times...).

Adding them shouldn't be that much of a problem, with the add_members 
script.
But I wonder about changing the attributes. Is there a way, via withlist 
or anything else, to batch this kind of task?

I would greatly appreciate any help.

Best regards,

Benjamin Roger
--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp


Re: [Mailman-Users] Batch member attributes

2006-05-22 Thread Mark Sapiro
Benjamin Roger wrote:
>
>I am somewhat desperate - I need a few people to be able to post on 
>about 80 lists (cascaded) here, without moderation (moderation being the 
>default setting for members).
>I think that to achieve this, I need to add them as members - and then 
>change their attributes, so they're not moderated, and do *not* receive 
>mails (80 times...).


This is one way to do it, but it is insecure as it allows anyone to
post be spoofing the unmoderated user's address.

A much better way is to give these authorized posters the moderator
password for the lists and have them post using an Approved: header or
first body line. Although, if they reallty need 80 different passwords
each, I can see that would be quite a pain.


>Adding them shouldn't be that much of a problem, with the add_members 
>script.
>But I wonder about changing the attributes. Is there a way, via withlist 
>or anything else, to batch this kind of task?


Yes. You could do it with a withlist script. You could add them too in
the same script if you want to.

The things you need to do in the withlist script would be

from Mailman import mm_cfg
from Mailman.Userdesc import Userdesc

Then to add a member

userdesc = Userdesc()
userdesc.address = 

See the AddMember definition in Mailman/MailList.py for other
(optional) userdesc attributes and their defaults.

Then do

mlist.ApprovedAddMember(userdesc, ack=x, admin_notif=x)

where x is True or False to add the member. The ack and admin_notif
arguments are optional and default to list settings.

To set a member's moderate flag off

mlist.setMemberOption(member, mm_cfg.Moderate, False)

where member is the members email address.

-- 
Mark Sapiro <[EMAIL PROTECTED]>   The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp


Re: [Mailman-Users] Batch member attributes

2006-05-24 Thread Benjamin Roger
Hello again,

Thanks for the support :-)

I finally have put together a set of commands which do a great job for me:

---
from Mailman import mm_cfg
from Mailman.UserDesc import UserDesc
from Mailman import MemberAdaptor
userdesc = UserDesc()
userdesc.address = ""
m.ApprovedAddMember(userdesc, ack=False, admin_notif=False)
m.setMemberOption("", mm_cfg.Moderate, False)
m.setMemberOption("", mm_cfg.AcknowledgePosts, False)
m.setDeliveryStatus("", MemberAdaptor.BYADMIN)
---

(note that I had to replace "mlist" by "m", which is the default 
variable in my version, and "UserDesc" needs a capital D)

But...that still isn't a batch script. I have to enter (/paste) this 
list of commands into the withlist console.

Isn't there something like a shell script for the withlist console? It 
would really be cool to be able to apply those commands to all lists at 
once, or, at least, to a particular list using a single command.

Best regards,

-br

> 
> 
> However, a much simpler approach for all but disabling delivery would
> be with a shell script, for each list run 'bin/config_list' to set
> new_member_options and default_member_moderation as desired, then
> 'bin/add_members' to add the members and finally bin/config_list to
> set the list back.
> 
> Next time ... :-)
> 
> 
--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp


Re: [Mailman-Users] Batch member attributes

2006-05-24 Thread Patrick Bogen
On 5/24/06, Benjamin Roger <[EMAIL PROTECTED]> wrote:
> Isn't there something like a shell script for the withlist console? It
> would really be cool to be able to apply those commands to all lists at
> once, or, at least, to a particular list using a single command.
>
FAQ 03.016 has a good example of how to use withlist like this:
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq03.016.htp

The important bits are the 'changeuserpw.py' it uses and the 'withlist
-l -r changeuserpw $list $member $passwd' line.
Basically, wrap your commands inside a python function (subroutine?
whatever python calls 'em), and give it arguments with the withlist
commands.

-- 
- Patrick Bogen
--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp


Re: [Mailman-Users] Batch member attributes

2006-05-25 Thread Mark Sapiro
Patrick Bogen wrote:

>On 5/24/06, Benjamin Roger <[EMAIL PROTECTED]> wrote:
>> Isn't there something like a shell script for the withlist console? It
>> would really be cool to be able to apply those commands to all lists at
>> once, or, at least, to a particular list using a single command.
>>
>FAQ 03.016 has a good example of how to use withlist like this:
>http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq03.016.htp


And

bin/withlist --help

also gives examples of using withlist with a script file.

Applying a script that needs the list locked to all lists (with the
'-a' option to withlist) is tricky because 'withlist -a' only unlocks
the last list so the script needs to do the unlocking. See

for a sample script that works whether or not you specify '-l' to
withlist.

-- 
Mark Sapiro <[EMAIL PROTECTED]>   The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan

--
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp