newsgroup->mailman moderation

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

On 7/12/15 8:05 AM, Danil Smirnov wrote:
The change suggested in that post was applied to the distributed code as of Mailman 2.1.17. See <https://bugs.launchpad.net/mailman/+bug/1252575>.
The change you suggest will 'hold' all non-member posts from usenet as long as generic_nonmember_action is other than accept and the poster's address is not in one of the *_these_nonmember filters.
If that's what you want, then the change looks correct.
On the other hand, you could just remove the fromusenet test and apply generic_nonmember_action to all posts whether or not from Usenet. I.e., just change
if mlist.generic_nonmember_action == 0 or msgdata.get('fromusenet'):
to
if mlist.generic_nonmember_action == 0:
The difference is with your change if generic_nonmember_action is Reject or Discard, posts from Usenet will still be held and not rejected or discarded, but just removing the fromusenet test will allow generic_nonmember_action to apply to all posts.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Another question: how about acknowledges for users from the Usernet? Will they get them after post will be gatewaying to the list?

On 7/13/15 3:16 AM, Danil Smirnov wrote:
Another question: how about acknowledges for users from the Usernet? Will they get them after post will be gatewaying to the list?
If a post from someone who is a member of the gated mail list is gated from the Usenet group to the mail list, and the poster's "Receive acknowledgement mail when you send mail to the list?" (ack) option is Yes, an acknowledgement will be sent when the post is delivered to the mail list.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

2015-07-13 17:23 GMT+03:00 Mark Sapiro <mark@msapiro.net>:
It looks like I'm confused with this topic.
I'm afraid of the situation where people from Usenet become get some notifications from the Mailman saying, for instance, that their message is placed on hold for moderation or similar. This is very undesirable situation (actual spamming of them) and I worry a lot about it after correction in Moderate.py I made.
Danil

On 7/13/15 7:36 AM, Danil Smirnov wrote:
Or I was confused ...
Notices to the poster of held posts are not sent if the post is gated from Usenet.
If a post gated from Usenet is rejected because it is from a non-member in reject_these_nonmembers or with your change a non-member with generic_nonmember_action = Reject or from a moderated member with member_moderation action = Reject, a notice will be sent. The moral here is never Reject non-member posts, either Hold them or Discard them.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

2015-07-13 18:05 GMT+03:00 Mark Sapiro <mark@msapiro.net>:
member_moderation action = Reject, a notice will be sent. The moral here is never Reject non-member posts, either Hold them or Discard them.
Got it, Mark!
To complete the topic, I would like also to add Mailman footers to messages, gatewayed to the group. (They are not added by default...) Could you please point me to the lines of code doing this?
Thanks, Danil

On 7/17/15 2:13 AM, Danil Smirnov wrote:
Headers/Footers are added by Mailman/Handlers/Decorate.py. Decorate.process is called by Mailman/Handlers/SPTPDirect.py to apply the replacements to msg_header and msg_footer and add them to the message. You would need to do something similar in Mailman/Handlers/ToUsenet.py.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 7/19/15 2:17 AM, Danil Smirnov wrote:
Your patch didn't make it through this list's content filtering which accepts only text/plain, text/x-diff and application/pgp-signature elementary MIME types.
A better way to deal with this for MM 2.1 is to create an issue at <https://bugs.launchpad.net/mailman/+filebug> and attach your patch or a merge proposal.
For MM 3 the process is similar except the tracker is at <https://gitlab.com/mailman/mailman/issues>.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 7/12/15 8:05 AM, Danil Smirnov wrote:
The change suggested in that post was applied to the distributed code as of Mailman 2.1.17. See <https://bugs.launchpad.net/mailman/+bug/1252575>.
The change you suggest will 'hold' all non-member posts from usenet as long as generic_nonmember_action is other than accept and the poster's address is not in one of the *_these_nonmember filters.
If that's what you want, then the change looks correct.
On the other hand, you could just remove the fromusenet test and apply generic_nonmember_action to all posts whether or not from Usenet. I.e., just change
if mlist.generic_nonmember_action == 0 or msgdata.get('fromusenet'):
to
if mlist.generic_nonmember_action == 0:
The difference is with your change if generic_nonmember_action is Reject or Discard, posts from Usenet will still be held and not rejected or discarded, but just removing the fromusenet test will allow generic_nonmember_action to apply to all posts.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Another question: how about acknowledges for users from the Usernet? Will they get them after post will be gatewaying to the list?

On 7/13/15 3:16 AM, Danil Smirnov wrote:
Another question: how about acknowledges for users from the Usernet? Will they get them after post will be gatewaying to the list?
If a post from someone who is a member of the gated mail list is gated from the Usenet group to the mail list, and the poster's "Receive acknowledgement mail when you send mail to the list?" (ack) option is Yes, an acknowledgement will be sent when the post is delivered to the mail list.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

2015-07-13 17:23 GMT+03:00 Mark Sapiro <mark@msapiro.net>:
It looks like I'm confused with this topic.
I'm afraid of the situation where people from Usenet become get some notifications from the Mailman saying, for instance, that their message is placed on hold for moderation or similar. This is very undesirable situation (actual spamming of them) and I worry a lot about it after correction in Moderate.py I made.
Danil

On 7/13/15 7:36 AM, Danil Smirnov wrote:
Or I was confused ...
Notices to the poster of held posts are not sent if the post is gated from Usenet.
If a post gated from Usenet is rejected because it is from a non-member in reject_these_nonmembers or with your change a non-member with generic_nonmember_action = Reject or from a moderated member with member_moderation action = Reject, a notice will be sent. The moral here is never Reject non-member posts, either Hold them or Discard them.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

2015-07-13 18:05 GMT+03:00 Mark Sapiro <mark@msapiro.net>:
member_moderation action = Reject, a notice will be sent. The moral here is never Reject non-member posts, either Hold them or Discard them.
Got it, Mark!
To complete the topic, I would like also to add Mailman footers to messages, gatewayed to the group. (They are not added by default...) Could you please point me to the lines of code doing this?
Thanks, Danil

On 7/17/15 2:13 AM, Danil Smirnov wrote:
Headers/Footers are added by Mailman/Handlers/Decorate.py. Decorate.process is called by Mailman/Handlers/SPTPDirect.py to apply the replacements to msg_header and msg_footer and add them to the message. You would need to do something similar in Mailman/Handlers/ToUsenet.py.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 7/19/15 2:17 AM, Danil Smirnov wrote:
Your patch didn't make it through this list's content filtering which accepts only text/plain, text/x-diff and application/pgp-signature elementary MIME types.
A better way to deal with this for MM 2.1 is to create an issue at <https://bugs.launchpad.net/mailman/+filebug> and attach your patch or a merge proposal.
For MM 3 the process is similar except the tracker is at <https://gitlab.com/mailman/mailman/issues>.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Danil Smirnov
-
Mark Sapiro