summaryrefslogtreecommitdiff
path: root/src/mailman/chains
diff options
context:
space:
mode:
authorAurélien Bompard2016-02-09 12:23:38 +0100
committerBarry Warsaw2016-03-31 18:29:27 -0400
commit71cfeda5fb51c49fd87b6d34e00221a3725b9ec0 (patch)
treed571db90e7010643ea7cca81ab91eaee89e0f378 /src/mailman/chains
parent011d278abcc25d417673f70a4eac0a8a78137d95 (diff)
downloadmailman-71cfeda5fb51c49fd87b6d34e00221a3725b9ec0.tar.gz
mailman-71cfeda5fb51c49fd87b6d34e00221a3725b9ec0.tar.zst
mailman-71cfeda5fb51c49fd87b6d34e00221a3725b9ec0.zip
Members and nonmembers moderation action fallback
Members and nonmember's moderation action should be None by default, and in that case the moderation rule should fallback to the mailing list's default action. Fixes: #189
Diffstat (limited to 'src/mailman/chains')
-rw-r--r--src/mailman/chains/docs/moderation.rst29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/mailman/chains/docs/moderation.rst b/src/mailman/chains/docs/moderation.rst
index cd0a8eb26..2415b8f4b 100644
--- a/src/mailman/chains/docs/moderation.rst
+++ b/src/mailman/chains/docs/moderation.rst
@@ -33,12 +33,7 @@ determined by the mailing list's settings. By default, a mailing list is not
set to moderate new member postings.
::
- >>> from mailman.testing.helpers import subscribe
- >>> member = subscribe(mlist, 'Anne', email='anne@example.com')
- >>> member
- <Member: Anne Person <anne@example.com> on test@example.com
- as MemberRole.member>
- >>> print(member.moderation_action)
+ >>> print(mlist.default_member_action)
Action.defer
In order to find out whether the message is held or accepted, we can subscribe
@@ -58,6 +53,18 @@ to Zope events that are triggered on each case.
... for miss in event.msgdata.get('rule_misses', []):
... print(' ', miss)
+The user Anne will be a list member. A list member's default moderation action
+is ``None``, meaning that it will use the mailing list's
+``default_member_action``.
+
+ >>> from mailman.testing.helpers import subscribe
+ >>> member = subscribe(mlist, 'Anne', email='anne@example.com')
+ >>> member
+ <Member: Anne Person <anne@example.com> on test@example.com
+ as MemberRole.member>
+ >>> print(member.moderation_action is None)
+ True
+
Anne's post to the mailing list runs through the incoming runner's default
built-in chain. No rules hit and so the message is accepted.
::
@@ -173,8 +180,8 @@ Nonmembers
==========
Registered nonmembers are handled very similarly to members, the main
-difference being that they usually have a default moderation action. This is
-how the incoming runner adds sender addresses as nonmembers.
+difference being that the mailing list's default moderation action is
+different. This is how the incoming runner adds sender addresses as nonmembers.
>>> from zope.component import getUtility
>>> from mailman.interfaces.usermanager import IUserManager
@@ -211,5 +218,11 @@ moderator approval.
>>> nonmember = mlist.nonmembers.get_member('bart@example.com')
>>> nonmember
<Member: bart@example.com on test@example.com as MemberRole.nonmember>
+
+A nonmember's default moderation action is ``None``, meaning that it will use
+the mailing list's ``default_nonmember_action``.
+
>>> print(nonmember.moderation_action)
+ None
+ >>> print(mlist.default_nonmember_action)
Action.hold