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

Modified Files:
        SimpleMatch.py SimpleWarning.py 
Log Message:
Updated SimpleWarning to return Stop. Updated SimpleMatch to catch a few more
Added some more test cases.

Index: SimpleMatch.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Bouncers/SimpleMatch.py,v
retrieving revision 2.16
retrieving revision 2.17
diff -u -d -r2.16 -r2.17
--- SimpleMatch.py      3 Mar 2006 18:53:58 -0000       2.16
+++ SimpleMatch.py      6 Mar 2006 18:13:23 -0000       2.17
@@ -95,6 +95,14 @@
     (_c('A message that you sent could not be delivered'),
      _c('^--- The header of the original'),
      _c('^(?P<addr>[EMAIL PROTECTED]@[^\s@:]+):')),
+    # thehartford.com
+    (_c('Delivery to the following recipients failed'),
+     _c("Bogus - there actually isn't anything"),
+     _c('^\s*(?P<addr>[EMAIL PROTECTED]@[EMAIL PROTECTED])\s*$')),
+    # and another thehartfod.com/hartfordlife.com
+    (_c('^Your message'),
+     _c('^because:'),
+     _c('^\s*(?P<addr>[EMAIL PROTECTED]@[EMAIL PROTECTED])\s*$')),
     # Next one goes here...
     ]
 

Index: SimpleWarning.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Bouncers/SimpleWarning.py,v
retrieving revision 2.4
retrieving revision 2.5
diff -u -d -r2.4 -r2.5
--- SimpleWarning.py    27 Aug 2005 01:54:02 -0000      2.4
+++ SimpleWarning.py    6 Mar 2006 18:13:23 -0000       2.5
@@ -1,4 +1,4 @@
-# Copyright (C) 2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2006 by the Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -12,10 +12,12 @@
 # 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software 
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
 
 """Recognizes simple heuristically delimited warnings."""
 
+from Mailman.Bouncers.BouncerAPI import Stop
 from Mailman.Bouncers.SimpleMatch import _c
 from Mailman.Bouncers.SimpleMatch import process as _process
 
@@ -41,4 +43,8 @@
 
 
 def process(msg):
-    return _process(msg, patterns)
+    if _process(msg, patterns):
+        # It's a recognized warning so stop now
+        return Stop
+    else:
+        return []

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

Reply via email to