[Mailman-Users] newsgroup->mailman moderation

Danil Smirnov danil at smirnov.la
Sun Jul 12 17:05:21 CEST 2015


Hi Mark!

I've found your posting advising how to set all posts from Usenet
group to moderation:

https://mail.python.org/pipermail/mailman-users/2013-June/075346.html

When look into Moderate.py I've found another code than mentioned in the post:

---
    # Okay, so the sender wasn't specified explicitly by any of the non-member
    # moderation configuration variables.  Handle by way of generic non-member
    # action.
    assert 0 <= mlist.generic_nonmember_action <= 4
    if mlist.generic_nonmember_action == 0 or msgdata.get('fromusenet'):
        # Accept
        return
    elif mlist.generic_nonmember_action == 1:
        Hold.hold_for_approval(mlist, msg, msgdata, Hold.NonMemberPost)
    elif mlist.generic_nonmember_action == 2:
        do_reject(mlist)
    elif mlist.generic_nonmember_action == 3:
        do_discard(mlist, msg)
---

Is it correct to change the code in this way?

---
    # Okay, so the sender wasn't specified explicitly by any of the non-member
    # moderation configuration variables.  Handle by way of generic non-member
    # action.
    assert 0 <= mlist.generic_nonmember_action <= 4
    if mlist.generic_nonmember_action == 0:
        # Accept
        return
    elif mlist.generic_nonmember_action == 1 or msgdata.get('fromusenet'):
        Hold.hold_for_approval(mlist, msg, msgdata, Hold.NonMemberPost)
    elif mlist.generic_nonmember_action == 2:
        do_reject(mlist)
    elif mlist.generic_nonmember_action == 3:
        do_discard(mlist, msg)
---

TIA,
Danil


More information about the Mailman-Users mailing list