FAQ
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

Search Discussions

  • Mark Sapiro at May 23, 2006 at 4:39 am

    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 = <the member's email 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 <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Jim Popovitch at May 23, 2006 at 5:43 am

    Mark Sapiro wrote:
    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.
    This is a question that has been bugging me for a while. If a moderator
    adds an "Approved: xxxxxx" header but misspells "Approved", then their
    password goes on to the list for all to see. Without setting filters
    for each and every password (esp., moderator passwords which I prefer
    admins to not know, and vice versa) is it a good idea to add a feature
    to Mailman that would automatically hold emails that contained an admin
    or moderator password in the first few lines of the email body?

    -Jim P>
  • Mark Sapiro at May 23, 2006 at 6:12 am

    Jim Popovitch wrote:
    This is a question that has been bugging me for a while. If a moderator
    adds an "Approved: xxxxxx" header but misspells "Approved", then their
    password goes on to the list for all to see. Without setting filters
    for each and every password (esp., moderator passwords which I prefer
    admins to not know, and vice versa) is it a good idea to add a feature
    to Mailman that would automatically hold emails that contained an admin
    or moderator password in the first few lines of the email body?

    Well, we already accept "Approve:" and are case insensitive. Beyond
    that, it might be difficult in general because we don't have a plain
    text password to look for, so we would need to check every 'word'
    against the admin and moderator passwords and maybe the site password
    just in case someone thought it could be used here, and we still
    wouldn't catch a misspelled password or one with an extra space in it.

    Consider the possibility that someone had a hand shifted on the
    keyboard and mistyped both Approved: and the password. It would be
    fairly easy for a human to figure out what happened and decode the
    password, but I don't know how to program it's detection in advance.

    There are some possibilities to consider. We could hold any post with a
    "header like" line in the body that wasn't Subject: or Keywords:, but
    is this necessary? Presumably, if approve(d) is misspelled, the post
    will be held anyway. If not, why are we putting an approved line there
    in the first place?

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Jim Popovitch at May 23, 2006 at 6:16 am

    Mark Sapiro wrote:
    Presumably, if approve(d) is misspelled, the post will be held
    anyway. If not, why are we putting an approved line there in the
    first place?
    Now that is a good thought to ponder.

    Thanks Mark.

    -Jim P.
  • Benjamin Roger at May 24, 2006 at 9:09 pm
    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 = "<e-mail address>"
    m.ApprovedAddMember(userdesc, ack=False, admin_notif=False)
    m.setMemberOption("<e-mail address>", mm_cfg.Moderate, False)
    m.setMemberOption("<e-mail address>", mm_cfg.AcknowledgePosts, False)
    m.setDeliveryStatus("<e-mail address>", 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 ... :-)
  • Patrick Bogen at May 24, 2006 at 9:43 pm

    On 5/24/06, Benjamin Roger 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
  • Mark Sapiro at May 26, 2006 at 4:28 am

    Patrick Bogen wrote:
    On 5/24/06, Benjamin Roger 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
    <http://mail.python.org/pipermail/mailman-users/2006-February/049447.html>
    for a sample script that works whether or not you specify '-l' to
    withlist.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedMay 22, '06 at 7:53p
activeMay 26, '06 at 4:28a
posts8
users4
websitelist.org

People

Translate

site design / logo © 2022 Grokbase