Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5567

Modified Files:
      Tag: Release_2_1-maint
        SpamDetect.py 
Log Message:
Prevent loop in hold/reject if addressed to '-owner'.


Index: SpamDetect.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/SpamDetect.py,v
retrieving revision 2.3.2.11
retrieving revision 2.3.2.12
diff -u -d -r2.3.2.11 -r2.3.2.12
--- SpamDetect.py       14 Jan 2006 10:11:19 -0000      2.3.2.11
+++ SpamDetect.py       29 Jan 2006 00:46:05 -0000      2.3.2.12
@@ -102,15 +102,6 @@
             if mo:
                 # we've detected spam, so throw the message away
                 raise SpamDetected
-    # Before we go to header_filter_rules, we exclude internally generated
-    # owner notification from checking, because 1) we collect headers from
-    # all the attachments but this will cause matching the filter rule again,
-    # and 2) list owners may want to check header name / value pair like
-    # 'Precedence: bulk' which is also generated by mailman.  Both will
-    # cause loop of holding owner notification messages if the action is
-    # set to 'hold'.
-    if msgdata.get('toowner') and msg.get('x-list-administrivia') == 'yes':
-        return
     # Now do header_filter_rules
     # TK: Collect headers in sub-parts because attachment filename
     # extension may be a clue to possible virus/spam.
@@ -132,9 +123,19 @@
                 if action == mm_cfg.DISCARD:
                     raise Errors.DiscardMessage
                 if action == mm_cfg.REJECT:
+                    if msgdata.get('toowner'):
+                        # Don't send rejection notice if addressed to '-owner'
+                        # because it may trigger a loop of notices if the
+                        # sender address is forged.  We just discard it here.
+                        raise Errors.DiscardMessage
                     raise Errors.RejectMessage(
                         _('Message rejected by filter rule match'))
                 if action == mm_cfg.HOLD:
+                    if msgdata.get('toowner'):
+                        # Don't hold '-owner' addressed message.  We just
+                        # pass it here but list-owner can set this to be
+                        # discarded on the GUI if he wants.
+                        return
                     hold_for_approval(mlist, msg, msgdata, HeaderMatchHold)
                 if action == mm_cfg.ACCEPT:
                     return

_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to