From 8150914806968df6a3cfd04dc74eed1882feac8b Mon Sep 17 00:00:00 2001 From: msapiro <> Date: Fri, 3 Mar 2006 18:52:19 +0000 Subject: Added some more bounce recognition to SimpleMatch and changed the logic so one all pattern sets are tried until a match is found so one start pattern whose address doesn't match won't preempt a later patern set that will match. Added more test cases. --- tests/bounces/simple_08.txt | 81 +++++++++++++++++++++++++++++++++++++++++++++ tests/bounces/simple_09.txt | 27 +++++++++++++++ tests/test_bounces.py | 4 +++ 3 files changed, 112 insertions(+) create mode 100644 tests/bounces/simple_08.txt create mode 100644 tests/bounces/simple_09.txt (limited to 'tests') diff --git a/tests/bounces/simple_08.txt b/tests/bounces/simple_08.txt new file mode 100644 index 00000000..c2067ce5 --- /dev/null +++ b/tests/bounces/simple_08.txt @@ -0,0 +1,81 @@ +Return-Path: +X-Original-To: newsletter-bounces@mydomain.de +Delivered-To: newsletter-bounces@mydomain.de +Received: by mailsrv.mycompanysname.lan (mycompanysname mail service, from userid 1004) + id AD5AC100A954; Tue, 28 Feb 2006 18:22:36 +0100 (CET) +X-Original-To: email@localhost.mydomain.de +Delivered-To: email@localhost.mydomain.de +Received: from localhost (localhost [127.0.0.1]) + by mailsrv.mycompanysname.lan (mycompanysname mail service) with ESMTP id B9B44100BF1B + for ; Tue, 28 Feb 2006 18:22:34 +0100 (CET) +Received: from mailsrv.mycompanysname.lan ([127.0.0.1]) + by localhost (mydomain.de [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 32002-08 for ; + Tue, 28 Feb 2006 18:22:33 +0100 (CET) +Received: from localhost (localhost [127.0.0.1]) + by mailsrv.mycompanysname.lan (mycompanysname mail service) with ESMTP id A093B100A955 + for ; Tue, 28 Feb 2006 18:22:33 +0100 (CET) +Delivery-Date: Tue, 28 Feb 2006 18:20:00 +0100 +Received-SPF: none (mxeu17: 212.227.126.240 is neither permitted nor denied by domain of mout-bounce.kundenserver.de) client-ip=212.227.126.240; envelope-from=postmaster@mout-bounce.kundenserver.de; helo=mout-bounce.kundenserver.de; +Received: from pop.1und1.com [212.227.15.161] + by localhost with POP3 (fetchmail-6.2.5.2) + for email@localhost (single-drop); Tue, 28 Feb 2006 18:22:33 +0100 (CET) +Received: from [212.227.126.240] (helo=mout-bounce.kundenserver.de) + by mx.kundenserver.de (node=mxeu17) with ESMTP (Nemesis), + id 0MKxIC-1FE8W00flx-0005g9 for newsletter-bounces@mydomain.de; Tue, 28 Feb 2006 18:20:00 +0100 +Received: from mout by mouteu2.kundenserver.de id 0MKvEC-1FE8V20Bkm-00025n; + Tue, 28 Feb 2006 18:19:00 +0100 +Date: Tue, 28 Feb 2006 18:19:00 +0100 +From: Mail Delivery System +To: newsletter-bounces@mydomain.de +Subject: Mail delivery failed: returning message to sender +Message-Id: <0MKvEC-1FE8V20Bkm-00025n@mouteu2.kundenserver.de> +X-Original-Id: 0ML25U-1FE8V12M9j-0006lD +Envelope-To: newsletter-bounces@mydomain.de +X-Virus-Scanned: amavisd-new at mydomain.de + +This message was created automatically by mail delivery software. + +A message that you sent could not be delivered to one or more of +its recipients. The following addresses failed: + + + +SMTP error from remote server after RCPT command: +host mailin02.sul.t-online.de[194.25.134.9]: +550 user unknown + + +--- The header of the original message is following. --- + +Received: from [84.154.27.78] (helo=mailsrv.mycompanysname.lan) + by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis), + id 0ML25U-1FE8V12M9j-0006lD; Tue, 28 Feb 2006 18:18:59 +0100 +Received: from localhost (localhost [127.0.0.1]) + by mailsrv.mycompanysname.lan (mycompanysname mail service) with ESMTP id EA2CD100A954 + for ; Tue, 28 Feb 2006 18:18:58 +0100 (CET) +Received: from mailsrv.mycompanysname.lan ([127.0.0.1]) + by localhost (mydomain.de [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 31861-10 for ; + Tue, 28 Feb 2006 18:18:58 +0100 (CET) +Received: from mailsrv.mycompanysname.lan (localhost [127.0.0.1]) + by mailsrv.mycompanysname.lan (mycompanysname mail service) with ESMTP id BB6BD100A308 + for ; Tue, 28 Feb 2006 18:18:58 +0100 (CET) +MIME-Version: 1.0 +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable +Subject: =?iso-8859-1?q?Sie_haben_die_Mailingliste_=22newsletter=22_ab?= + =?iso-8859-1?q?bestellt?= +From: newsletter-bounces@mydomain.de +Message-ID: +Date: Tue, 28 Feb 2006 18:18:57 +0100 +Precedence: bulk +X-BeenThere: newsletter@mydomain.de +X-Mailman-Version: 2.1.6 +List-Id: newsletter +X-List-Administrivia: yes +To: severin.XXX@t-online.de +Sender: newsletter-bounces@mydomain.de +Errors-To: newsletter-bounces@mydomain.de +X-Virus-Scanned: amavisd-new at mydomain.de +X-Provags-ID: kundenserver.de abuse@kundenserver.de login:50f36a15497f230366e1019f5ac05f49 diff --git a/tests/bounces/simple_09.txt b/tests/bounces/simple_09.txt new file mode 100644 index 00000000..340c410b --- /dev/null +++ b/tests/bounces/simple_09.txt @@ -0,0 +1,27 @@ +Return-Path: +Received: from moutng.kundenserver.de (moutng.kundenserver.de + [212.227.126.187]) + by sb7.songbird.com (8.12.11/8.12.11) with ESMTP id k0TN474K030502 + for ; Sun, 29 Jan 2006 15:04:07 -0800 +Received: from mx by mx.kundenserver.de id 0MKxMK-1F3LZu2Mij-0004S7; + Mon, 30 Jan 2006 00:03:26 +0100 +To: gpc-talk-bounces@grizz.org +From: "Mail Delivery System" +Subject: Mail delivery failed: returning message to sender +Date: Mon, 30 Jan 2006 00:03:26 +0100 +Message-ID: <0MKxMK-1F3LZu2Mij-0004S7@mx.kundenserver.de> +Precedence: bulk +X-Original-ID: 0MKxMK-1F3LZt3R61-0004S7 +X-SongbirdInformation: support@songbird.com for more information +X-Songbird: Found to be clean +X-Songbird-From: + +This message was created automatically by mail delivery software. + +A message that you sent could not be delivered to one or more of +its recipients. This is a permanent error. The following addresses +failed: + +RobotMail@auto-walther.de: + quota exceeded + diff --git a/tests/test_bounces.py b/tests/test_bounces.py index 9b09b5a6..1269fd5f 100644 --- a/tests/test_bounces.py +++ b/tests/test_bounces.py @@ -47,6 +47,8 @@ class BounceTest(unittest.TestCase): ('SimpleMatch', 'simple_05.txt', ['rlosardo@sbcglobal.net']), ('SimpleMatch', 'simple_06.txt', ['dlyle@hamiltonpacific.com']), ('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']), # SimpleWarning ('SimpleWarning', 'simple_03.txt', ['jacobus@geo.co.za']), # GroupWise @@ -55,6 +57,8 @@ class BounceTest(unittest.TestCase): # doesn't throw an exception, but we won't get any meaningful # addresses back from it. ('GroupWise', 'groupwise_02.txt', []), + # Actually, it's from Exchange, and Exchange does recognize it + ('Exchange', 'groupwise_02.txt', ['omarmo@thebas.com']), # Yale's own ('Yale', 'yale_01.txt', ['thomas.dtankengine@cs.yale.edu', 'thomas.dtankengine@yale.edu']), -- cgit v1.2.3