Barry Warsaw wrote:

> That seems right to me.  It doesn't make any sense to hold a message
> ultimately destined for the list owner or moderator because those are
> the people who have to approve the message (what? so they can then read
> it again in their inbox?).
> 
> If in response to a certain spam designation the owner destined message
> is discarded, that's fine.  But it shouldn't be held, and rejecting spam
> is almost always a bad idea.

OK, Barry.  I've come up with this patch (for the current CVS).
If its OK, I want to start up for the release of 2.1.8a1.

-- 
Tokio Kikuchi, tkikuchi@ is.kochi-u.ac.jp
http://weather.is.kochi-u.ac.jp/
Index: SpamDetect.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/SpamDetect.py,v
retrieving revision 2.3.2.11
diff -u -r2.3.2.11 SpamDetect.py
--- SpamDetect.py       14 Jan 2006 10:11:19 -0000      2.3.2.11
+++ SpamDetect.py       28 Jan 2006 02:01:34 -0000
@@ -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,18 @@
                 if action == mm_cfg.DISCARD:
                     raise Errors.DiscardMessage
                 if action == mm_cfg.REJECT:
+                    if msgdata.get('toowner'):
+                        # Don't send rejecting message if addressed
+                        # to '-owner'. We just discard 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-Developers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp

Reply via email to