diff options
author | msapiro <> | 2006-03-06 18:12:36 +0000 |
---|---|---|
committer | msapiro <> | 2006-03-06 18:12:36 +0000 |
commit | 01568fe1041a0002160a962526c1203bf65d2fc3 (patch) | |
tree | 923c13c68695dfc3bba2b5e72f8b9e4ca79921f0 | |
parent | 8150914806968df6a3cfd04dc74eed1882feac8b (diff) | |
download | mailman2-01568fe1041a0002160a962526c1203bf65d2fc3.tar.gz mailman2-01568fe1041a0002160a962526c1203bf65d2fc3.tar.xz mailman2-01568fe1041a0002160a962526c1203bf65d2fc3.zip |
Updated SimpleWarning to return Stop. Updated SimpleMatch to catch a few more
Added some more test cases.
-rw-r--r-- | Mailman/Bouncers/SimpleMatch.py | 8 | ||||
-rw-r--r-- | Mailman/Bouncers/SimpleWarning.py | 12 | ||||
-rw-r--r-- | tests/bounces/dsn_09.txt | 4 | ||||
-rw-r--r-- | tests/bounces/simple_10.txt | 45 | ||||
-rw-r--r-- | tests/bounces/simple_11.txt | 68 | ||||
-rw-r--r-- | tests/test_bounces.py | 6 |
6 files changed, 135 insertions, 8 deletions
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<addr>[^\s@]+@[^\s@:]+):')), + # thehartford.com + (_c('Delivery to the following recipients failed'), + _c("Bogus - there actually isn't anything"), + _c('^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')), + # and another thehartfod.com/hartfordlife.com + (_c('^Your message'), + _c('^because:'), + _c('^\s*(?P<addr>[^\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 [] diff --git a/tests/bounces/dsn_09.txt b/tests/bounces/dsn_09.txt index c24fc14d..89c0f9ad 100644 --- a/tests/bounces/dsn_09.txt +++ b/tests/bounces/dsn_09.txt @@ -1,7 +1,3 @@ -Received: by main.nlenet.net (mbox bob) - (with Cubic Circle's cucipop (v1.31 1998/05/13) Sun Nov 4 02:46:01 2001) -X-From_: postmaster@btconnect.com Sun Nov 4 02:45:50 2001 ->From bob Sun Nov 4 02:45:50 2001 Return-Path: <postmaster@btconnect.com> Delivered-To: bob@nlenet.net Received: from c2bapps1.btconnect.com (c2bapps1.btconnect.com [193.113.209.21]) diff --git a/tests/bounces/simple_10.txt b/tests/bounces/simple_10.txt new file mode 100644 index 00000000..dfc9c3cf --- /dev/null +++ b/tests/bounces/simple_10.txt @@ -0,0 +1,45 @@ +Return-Path: <MAILER-DAEMON@sb7.songbird.com> +Received: from netmail03.thehartford.com (hfdmailgate.thehartford.com + [162.136.189.90]) + by sb7.songbird.com (8.12.11/8.12.11) with ESMTP id k23KA05D028804 + (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) + for <gpc-talk-bounces@grizz.org>; Fri, 3 Mar 2006 12:10:01 -0800 +Received: from hfdzixvpm004.thehartford.com (hfdzixvpm004.thehartford.com + [10.129.67.20]) + by netmail03.thehartford.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id + k23K9Mj8024526 + for <gpc-talk-bounces@grizz.org>; Fri, 3 Mar 2006 15:09:22 -0500 (EST) +Received: from hfdzixvpm004.thehartford.com (ZixVPM [127.0.0.1]) + by Outbound.thehartford.com (Proprietary) with ESMTP id 6702827002F + for <gpc-talk-bounces@grizz.org>; Fri, 3 Mar 2006 15:09:22 -0500 (EST) +Received: from ad2simmsw007.ad2.prod (ad2simmsw007.ad2.prod [172.30.84.92]) + by hfdzixvpm004.thehartford.com (Proprietary) with ESMTP id 4C653284090 + for <gpc-talk-bounces@grizz.org>; Fri, 3 Mar 2006 15:09:22 -0500 (EST) +Received: from AD1SIMEXI301.ad1.prod (ad1simexi301.ad1.prod) by + ad2simmsw007.ad2.prod + (Content Technologies SMTPRS 4.3.17) with ESMTP id + <T76cd10a625ac1e545cf44@ad2simmsw007.ad2.prod> for + <gpc-talk-bounces@grizz.org>; Fri, 3 Mar 2006 15:09:21 -0500 +Received: from AD1HFDEXI301.ad1.prod ([10.129.76.24]) by AD1SIMEXI301.ad1.prod + with Microsoft SMTPSVC(6.0.3790.211); Fri, 3 Mar 2006 15:09:21 -0500 +From: postmaster@thehartford.com +To: gpc-talk-bounces@grizz.org +Date: Fri, 3 Mar 2006 15:09:20 -0500 +MIME-Version: 1.0 +Content-Type: Text/Plain +X-DSNContext: 335a7efd - 4523 - 00000001 - 80040546 +Message-ID: <F8nPweDnr00080a22@AD1HFDEXI301.ad1.prod> +Subject: Delivery Status Notification (Failure) +X-OriginalArrivalTime: 03 Mar 2006 20:09:21.0200 (UTC) + FILETIME=[5BF47300:01C63EFE] +X-SongbirdInformation: support@songbird.com for more information +X-Songbird: Found to be clean +X-Songbird-From: + +This is an automatically generated Delivery Status Notification. + +Delivery to the following recipients failed. + + sais@thehartford.com + + diff --git a/tests/bounces/simple_11.txt b/tests/bounces/simple_11.txt new file mode 100644 index 00000000..2d046db5 --- /dev/null +++ b/tests/bounces/simple_11.txt @@ -0,0 +1,68 @@ +Return-Path: <MAILER-DAEMON@sb7.songbird.com> +Received: from netmail04.thehartford.com (simmailgate.thehartford.com + [162.136.191.90]) + by sb7.songbird.com (8.12.11/8.12.11) with ESMTP id k24NGAof004309 + (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) + for <gpc-talk-bounces@grizz.org>; Sat, 4 Mar 2006 15:16:11 -0800 +Received: from hfdzixvpm004.thehartford.com (hfdzixvpm004.thehartford.com + [10.129.67.20]) + by netmail04.thehartford.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id + k24NFWrH006004 + for <gpc-talk-bounces@grizz.org>; Sat, 4 Mar 2006 18:15:33 -0500 (EST) +Received: from hfdzixvpm004.thehartford.com (ZixVPM [127.0.0.1]) + by Outbound.thehartford.com (Proprietary) with ESMTP id CE83927002F + for <gpc-talk-bounces@grizz.org>; Sat, 4 Mar 2006 18:15:32 -0500 (EST) +Received: from ad2simmsw006.ad2.prod (ad2simmsw006.ad2.prod [172.30.84.91]) + by hfdzixvpm004.thehartford.com (Proprietary) with ESMTP id B6E5F28408E + for <gpc-talk-bounces@grizz.org>; Sat, 4 Mar 2006 18:15:32 -0500 (EST) +Received: from lifesmtp2.hartfordlife.com (AD2HFDLGT002) by + ad2simmsw006.ad2.prod + (Content Technologies SMTPRS 4.3.17) with ESMTP id + <T76d2e1782bac1e545baa4@ad2simmsw006.ad2.prod> for + <gpc-talk-bounces@grizz.org>; Sat, 4 Mar 2006 18:15:32 -0500 +MIME-Version: 1.0 +Subject: DELIVERY FAILURE: User carlosr73 (carlosr73@hartfordlife.com) not + listed in Domino Directory +To: gpc-talk-bounces@grizz.org +Date: Sat, 04 Mar 2006 15:15:47 -0800 +Precedence: bulk +X-BeenThere: gpc-talk@grizz.org +X-Mailman-Version: 2.1.5 +List-Id: Grizzly Peak Cyclists general discussion list <gpc-talk.grizz.org> +X-List-Administrivia: yes +From: Postmaster@hartfordlife.com +Errors-To: gpc-talk-bounces@grizz.org +X-Songbird: Found to be clean, Found to be clean +X-PMX-Version: 4.7.1.128075, Antispam-Engine: 2.2.0.0, + Antispam-Data: 2006.03.04.144604 +X-PerlMx-Spam: Gauge=XXIIIIII, Probability=26%, + Report='OBFU_CLASS_FINANCIAL_LOW 3, NO_REAL_NAME 0, __CT 0, + __CTE 0, __CTYPE_CHARSET_QUOTED 0, __CT_TEXT_PLAIN 0, + __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, + __SANE_MSGID 0' +X-MIMETrack: Itemize by SMTP Server on LIFESMTP2/HLIFE(Release + 6.5.4FP2|September 12, 2005) at 03/04/2006 06:15:32 PM, + Serialize by Router on LIFESMTP2/HLIFE(Release 6.5.4FP2|September 12, + 2005) at 03/04/2006 06:15:32 PM, + Serialize complete at 03/04/2006 06:15:32 PM +Message-ID: <OF394AFEEE.6E330204-ON85257127.007FC408-85257127.007FC40C@hartfordlife.com> +Content-Type: Text/Plain +X-SongbirdInformation: support@songbird.com for more information +X-Songbird-From: +Content-Transfer-Encoding: 8bit +X-MIME-Autoconverted: from base64 to 8bit by sb7.songbird.com id k24NGAof004309 + +Your message + + Subject: Your message to GPC-talk awaits moderator approval + +was not delivered to: + + carlosr73@hartfordlife.com + +because: + + User carlosr73 (carlosr73@hartfordlife.com) not listed in Domino Directory + + + diff --git a/tests/test_bounces.py b/tests/test_bounces.py index 1269fd5f..e0979508 100644 --- a/tests/test_bounces.py +++ b/tests/test_bounces.py @@ -49,8 +49,10 @@ class BounceTest(unittest.TestCase): ('SimpleMatch', 'simple_07.txt', ['william.xxxx@sbcglobal.net']), ('SimpleMatch', 'simple_08.txt', ['severin.XXX@t-online.de']), ('SimpleMatch', 'simple_09.txt', ['RobotMail@auto-walther.de']), + ('SimpleMatch', 'simple_10.txt', ['sais@thehartford.com']), + ('SimpleMatch', 'simple_11.txt', ['carlosr73@hartfordlife.com']), # SimpleWarning - ('SimpleWarning', 'simple_03.txt', ['jacobus@geo.co.za']), + ('SimpleWarning', 'simple_03.txt', Stop), # GroupWise ('GroupWise', 'groupwise_01.txt', ['thoff@MAINEX1.ASU.EDU']), # This one really sucks 'cause it's text/html. Just make sure it @@ -142,6 +144,8 @@ class BounceTest(unittest.TestCase): if foundaddrs is None: foundaddrs = [] if foundaddrs is not Stop: + # MAS: The following strip() is only because of my + # hybrid test environment. It is not otherwise needed. foundaddrs = [found.strip() for found in foundaddrs] addrs.sort() foundaddrs.sort() |