summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2000-02-18 16:52:24 +0000
committerbwarsaw2000-02-18 16:52:24 +0000
commit07eb957805b0a0adc135cc75ab2efcd3f5145185 (patch)
treee370417f3a83e462cc925159470ca30678da761b
parent7c01958bf8241af38f13f2b22fcfa803bd0f56a0 (diff)
downloadmailman-07eb957805b0a0adc135cc75ab2efcd3f5145185.tar.gz
mailman-07eb957805b0a0adc135cc75ab2efcd3f5145185.tar.zst
mailman-07eb957805b0a0adc135cc75ab2efcd3f5145185.zip
NotExplicitlyAllowed: New class to represent message hold conditions
described below. process(): When members_posting_only is not set, but posters /is/ set, the semantics are that only those explicitly listed in posters can post without admin approval. Even though I think this is AFU'd, at least this patch fixes things so it works the same as it did in Mailman 1.1.
-rw-r--r--Mailman/Handlers/Hold.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py
index 9686fb397..c2690e9eb 100644
--- a/Mailman/Handlers/Hold.py
+++ b/Mailman/Handlers/Hold.py
@@ -56,6 +56,10 @@ class NonMemberPost(HandlerAPI.MessageHeld):
"Post by non-member to a members-only list"
pass
+class NotExplicitlyAllowed(HandlerAPI.MessageHeld):
+ "Posting to a restricted list by sender requires approval"
+ pass
+
class TooManyRecipients(HandlerAPI.MessageHeld):
"Too many recipients to the message"
pass
@@ -112,7 +116,8 @@ def process(mlist, msg):
# no return
#
# postings only from list members? mlist.posters are allowed in addition
- # to list members
+ # to list members. If not set, then only the members in posters are
+ # allowed to post without approval.
if mlist.member_posting_only:
posters = Utils.List2Dict(mlist.posters)
if not mlist.IsMember(sender) and \
@@ -121,6 +126,13 @@ def process(mlist, msg):
# explicitly approved posters
hold_for_approval(mlist, msg, NonMemberPost)
# no return
+ elif mlist.posters:
+ posters = Utils.List2Dict(mlist.posters)
+ if not Utils.FindMatchingAddresses(sender, posters):
+ # the sender is not explicitly in the list of allowed posters
+ # (which is non-empty), so hold the message
+ hold_for_approval(mlist, msg, NotExplicitlyAllowed)
+ # no return
#
# are there too many recipients to the message?
if mlist.max_num_recipients > 0: