diff options
author | Mark Sapiro <msapiro@value.net> | 2014-06-26 14:52:28 -0700 |
---|---|---|
committer | Mark Sapiro <msapiro@value.net> | 2014-06-26 14:52:28 -0700 |
commit | afd5ce9986f56b76a4904eff31aa2350d3075f52 (patch) | |
tree | 83c90656867df66339cf0a8b0245ac945c38e837 /Mailman/Handlers/Moderate.py | |
parent | 36436af656580651ae54af0e11922ae80c5450b1 (diff) | |
download | mailman2-afd5ce9986f56b76a4904eff31aa2350d3075f52.tar.gz mailman2-afd5ce9986f56b76a4904eff31aa2350d3075f52.tar.xz mailman2-afd5ce9986f56b76a4904eff31aa2350d3075f52.zip |
Moved the dmarc_moderation_action checks from the Moderate handler to
the SpamDetect handler so that the Reject and Discard actions will be
done before the message might be held by header_filter_rules, and the
Wrap Message and Munge From actions will be done on messages held by
header_filter_rules if the message is approved. (LP: #1334450)
Diffstat (limited to '')
-rw-r--r-- | Mailman/Handlers/Moderate.py | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/Mailman/Handlers/Moderate.py b/Mailman/Handlers/Moderate.py index 096eedce..4400d086 100644 --- a/Mailman/Handlers/Moderate.py +++ b/Mailman/Handlers/Moderate.py @@ -50,32 +50,7 @@ class ModeratedMemberPost(Hold.ModeratedPost): def process(mlist, msg, msgdata): if msgdata.get('approved'): return - # Before anything else, check DMARC if necessary. - msgdata['from_is_list'] = 0 - dn, addr = parseaddr(msg.get('from')) - if addr and mlist.dmarc_moderation_action > 0: - if Utils.IsDMARCProhibited(mlist, addr): - # Note that for dmarc_moderation_action, 0 = Accept, - # 1 = Munge, 2 = Wrap, 3 = Reject, 4 = Discard - if mlist.dmarc_moderation_action == 1: - msgdata['from_is_list'] = 1 - elif mlist.dmarc_moderation_action == 2: - msgdata['from_is_list'] = 2 - elif mlist.dmarc_moderation_action == 3: - # Reject - text = mlist.dmarc_moderation_notice - if text: - text = Utils.wrap(text) - else: - text = Utils.wrap(_( -"""You are not allowed to post to this mailing list From: a domain which -publishes a DMARC policy of reject or quarantine, and your message has been -automatically rejected. If you think that your messages are being rejected in -error, contact the mailing list owner at %(listowner)s.""")) - raise Errors.RejectMessage, text - elif mlist.dmarc_moderation_action == 4: - raise Errors.DiscardMessage - # Then, is the poster a member or not? + # Is the poster a member or not? for sender in msg.get_senders(): if mlist.isMember(sender): break |