From 01568fe1041a0002160a962526c1203bf65d2fc3 Mon Sep 17 00:00:00 2001 From: msapiro <> Date: Mon, 6 Mar 2006 18:12:36 +0000 Subject: Updated SimpleWarning to return Stop. Updated SimpleMatch to catch a few more Added some more test cases. --- Mailman/Bouncers/SimpleMatch.py | 8 ++++++++ Mailman/Bouncers/SimpleWarning.py | 12 +++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'Mailman/Bouncers') diff --git a/Mailman/Bouncers/SimpleMatch.py b/Mailman/Bouncers/SimpleMatch.py index a530f36f..c3749b4a 100644 --- a/Mailman/Bouncers/SimpleMatch.py +++ b/Mailman/Bouncers/SimpleMatch.py @@ -95,6 +95,14 @@ PATTERNS = [ (_c('A message that you sent could not be delivered'), _c('^--- The header of the original'), _c('^(?P[^\s@]+@[^\s@:]+):')), + # thehartford.com + (_c('Delivery to the following recipients failed'), + _c("Bogus - there actually isn't anything"), + _c('^\s*(?P[^\s@]+@[^\s@]+)\s*$')), + # and another thehartfod.com/hartfordlife.com + (_c('^Your message'), + _c('^because:'), + _c('^\s*(?P[^\s@]+@[^\s@]+)\s*$')), # Next one goes here... ] diff --git a/Mailman/Bouncers/SimpleWarning.py b/Mailman/Bouncers/SimpleWarning.py index eefd46a5..733994eb 100644 --- a/Mailman/Bouncers/SimpleWarning.py +++ b/Mailman/Bouncers/SimpleWarning.py @@ -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 @@ patterns = [ def process(msg): - return _process(msg, patterns) + if _process(msg, patterns): + # It's a recognized warning so stop now + return Stop + else: + return [] -- cgit v1.2.3