summaryrefslogtreecommitdiff
path: root/Mailman
diff options
context:
space:
mode:
authorbwarsaw2002-03-07 22:35:37 +0000
committerbwarsaw2002-03-07 22:35:37 +0000
commit1a09c9eaf25fe2b1ec0eebda8176171f75398cf3 (patch)
tree9e286b150a67b67b0d30708a2441188d4e2062be /Mailman
parent41e869a382e5b2e9bdc0d6b2f98afe86fe7b78a4 (diff)
downloadmailman-1a09c9eaf25fe2b1ec0eebda8176171f75398cf3.tar.gz
mailman-1a09c9eaf25fe2b1ec0eebda8176171f75398cf3.tar.zst
mailman-1a09c9eaf25fe2b1ec0eebda8176171f75398cf3.zip
process(): Application of Jason Mastaler's patch #509386 which loosens
the membership test to check additional headers. I've modified Jason's patch in the following ways: - get_author() -> get_senders() even though I suggested the former. ;) I'd like to eventually deprecate get_sender() so this will be its eventual replacement. - Some implementation details. do_discard(): Changed the message that gets sent with auto-discarded messages. It might have been discarded because of the default non-member action, in which case the old message wasn't really accurate. I don't think the reason for discarding is all that important right now. Translators: beware!
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Handlers/Moderate.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/Mailman/Handlers/Moderate.py b/Mailman/Handlers/Moderate.py
index cbcf795b9..9275052f8 100644
--- a/Mailman/Handlers/Moderate.py
+++ b/Mailman/Handlers/Moderate.py
@@ -40,8 +40,12 @@ def process(mlist, msg, msgdata):
if msgdata.get('approved'):
return
# First of all, is the poster a member or not?
- sender = msg.get_sender()
- if mlist.isMember(sender):
+ for sender in msg.get_senders():
+ if mlist.isMember(sender):
+ break
+ else:
+ sender = None
+ if sender:
# If the member's moderation flag is on, then perform the moderation
# action.
if mlist.getMemberOption(sender, mm_cfg.Moderate):
@@ -71,6 +75,8 @@ def process(mlist, msg, msgdata):
# this point? No, because further pipeline handlers will need to do
# their own thing.
return
+ else:
+ sender = msg.get_sender()
# From here on out, we're dealing with non-members.
if matches_p(sender, mlist.accept_these_nonmembers):
return
@@ -138,13 +144,8 @@ def do_discard(mlist, msg):
_('Auto-discard notification'),
lang=mlist.preferred_language)
nmsg.set_type('multipart/mixed')
- text = MIMEText(Utils.wrap(_("""\
-The attached message has been automatically discarded because the sender's
-address, %(sender)s, was on the discard_these_nonmembers list. For the list
-of auto-discard addresses, see
-
- %(varhelp)s
-""")))
+ text = MIMEText(Utils.wrap(_(
+ 'The attached message has been automatically discarded.')))
nmsg.attach(text)
nmsg.attach(MIMEMessage(msg))
nmsg.send(mlist)