diff options
| author | bwarsaw | 2002-12-02 14:51:44 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-12-02 14:51:44 +0000 |
| commit | 34a0597c8ead9c7ee24b94dc3d1e503a831fc9f4 (patch) | |
| tree | 98d6d94a32554d04e4ede698ce204532ab6a38a9 | |
| parent | ebe3977de2dd6dd47cdaf08b9d99391d63e2338a (diff) | |
| download | mailman-34a0597c8ead9c7ee24b94dc3d1e503a831fc9f4.tar.gz mailman-34a0597c8ead9c7ee24b94dc3d1e503a831fc9f4.tar.zst mailman-34a0597c8ead9c7ee24b94dc3d1e503a831fc9f4.zip | |
| -rw-r--r-- | tests/bounces/bounce_02.txt | 36 | ||||
| -rw-r--r-- | tests/bounces/bounce_03.txt | 109 | ||||
| -rw-r--r-- | tests/bounces/dsn_11.txt | 176 | ||||
| -rwxr-xr-x | tests/onebounce.py | 94 |
4 files changed, 415 insertions, 0 deletions
diff --git a/tests/bounces/bounce_02.txt b/tests/bounces/bounce_02.txt new file mode 100644 index 000000000..0f7d7f32d --- /dev/null +++ b/tests/bounces/bounce_02.txt @@ -0,0 +1,36 @@ +From: E500_SMTP_Mail_Service@lerctr.org +To: <macarthur1975-bounces@lerctr.org> +Subject: Returned Mail - Error During Delivery +Date: Wed, 20 Nov 2002 19:58:47 -0500 (EST) +X-Virus-Scanned: by amavisd-milter (http://amavis.org/) + +------ Failed Recipients ------ + +<acinsp1@midsouth.rr.com>: Requested action not taken: mailbox unavailable. [SMTP Error Code 550] +-------- Returned Mail -------- + +Received: from tnmx01.mgw.rr.com(24.165.200.11) by tnav01.midsouth.rr.com via csmap + id 26013; Wed, 20 Nov 2002 19:58:47 -0500 (EST) +Received: from lerami.lerctr.org (lerami.lerctr.org [207.158.72.11]) + by tnmx01.mgw.rr.com (8.12.5/8.12.5) with ESMTP id gAL0wLBM020447 + for <acinsp1@midsouth.rr.com>; Wed, 20 Nov 2002 19:58:21 -0500 (EST) +Received: from lerami.lerctr.org (localhost [127.0.0.1]) + by lerami.lerctr.org (8.12.6/8.12.6/20020902/$Revision: 5940 $) with ESMTP id gAL0wHwV016400 + for <acinsp1@midsouth.rr.com>; Wed, 20 Nov 2002 18:58:18 -0600 (CST) +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Subject: You have been unsubscribed from the MacArthur1975 mailing list +From: macarthur1975-bounces@lerctr.org +To: acinsp1@midsouth.rr.com +Message-ID: <mailman.0.1037840296.16399.macarthur1975@lerctr.org> +Date: Wed, 20 Nov 2002 18:58:16 -0600 +Precedence: bulk +X-BeenThere: macarthur1975@lerctr.org +X-Mailman-Version: 2.1b4 +List-Id: MacArthur Class of 1975 Discussion <macarthur1975.lerctr.org> +X-List-Administrivia: yes +Sender: macarthur1975-bounces@lerctr.org +Errors-To: macarthur1975-bounces@lerctr.org +X-Virus-Scanned: by amavisd-milter (http://amavis.org/) + diff --git a/tests/bounces/bounce_03.txt b/tests/bounces/bounce_03.txt new file mode 100644 index 000000000..fc62dcab6 --- /dev/null +++ b/tests/bounces/bounce_03.txt @@ -0,0 +1,109 @@ +Received: from tele-punt-22.mail.demon.net ([194.217.242.7]) + by mail.python.org with esmtp (Exim 4.05) + id 18GwM4-0000D4-00 + for mailman-users-admin@python.org; Wed, 27 Nov 2002 02:11:28 -0500 +Received: from root by tele-punt-22.mail.demon.net with local (Exim 2.12 #1) + id 18GwLf-0003ka-00 + for mailman-users-admin@python.org; Wed, 27 Nov 2002 07:11:03 +0000 +Subject: Mail delivery failure +Message-Id: <E18GwLf-0003ka-00@tele-punt-22.mail.demon.net> +From: Mail Delivery System <Mailer-Daemon@tele-punt-22.mail.demon.net> +To: mailman-users-admin@python.org +Date: Wed, 27 Nov 2002 07:11:03 +0000 +X-Spam-Status: No, hits=-2.5 required=5.0 + tests=FROM_MAILER_DAEMON,MAILER_DAEMON,MAILTO_WITH_SUBJ,SPAM_PHRASE_03_05 +X-Spam-Level: + +This message was created automatically by mail delivery +software. A message that you sent could not be delivered +to all of its recipients. + +The following message, addressed to 'james@jeborall.demon.co.uk', +failed because it has not been collected after 30 days + +Here is a copy of the first part of the message, including +all headers. + +---- START OF RETURNED MESSAGE ---- +Received: from punt-2.mail.demon.net by mailstore for james@jeborall.demon.co.uk + id 1035738253:20:01723:229; Sun, 27 Oct 2002 17:04:13 GMT +Received: from mail.python.org ([12.155.117.29]) by punt-2.mail.demon.net + id aa2004462; 27 Oct 2002 17:02 GMT +Received: from localhost.localdomain ([127.0.0.1] helo=mail.python.org) + by mail.python.org with esmtp (Exim 4.05) + id 185qn2-0007ru-00; Sun, 27 Oct 2002 12:01:28 -0500 +Date: Sun, 27 Oct 2002 12:00:04 -0500 +Message-ID: <20021027170004.27298.9909.Mailman@mail.python.org> +From: mailman-users-request@python.org +Subject: Mailman-Users digest, Vol 1 #2344 - 14 msgs +Reply-to: mailman-users@python.org +X-Mailer: Mailman v2.0.13 (101270) +MIME-version: 1.0 +Content-type: multipart/mixed; boundary=10.0.11.1.506.27298.1035738004.364.17787 +To: mailman-users@python.org +Sender: mailman-users-admin@python.org +Errors-To: mailman-users-admin@python.org +X-BeenThere: mailman-users@python.org +X-Mailman-Version: 2.0.13 (101270) +Precedence: bulk +List-Help: <mailto:mailman-users-request@python.org?subject=help> +List-Post: <mailto:mailman-users@python.org> +List-Subscribe: <http://mail.python.org/mailman/listinfo/mailman-users>, + <mailto:mailman-users-request@python.org?subject=subscribe> +List-Id: Mailman mailing list management users <mailman-users.python.org> +List-Unsubscribe: <http://mail.python.org/mailman/listinfo/mailman-users>, + <mailto:mailman-users-request@python.org?subject=unsubscribe> +List-Archive: <http://mail.python.org/pipermail/mailman-users/> + +--10.0.11.1.506.27298.1035738004.364.17787 +Content-type: text/plain; charset=us-ascii +Content-description: Masthead (Mailman-Users digest, Vol 1 #2344) + +Send Mailman-Users mailing list submissions to + mailman-users@python.org + +To subscribe or unsubscribe via the World Wide Web, visit + http://mail.python.org/mailman/listinfo/mailman-users +or, via email, send a message with subject or body 'help' to + mailman-users-request@python.org + +You can reach the person managing the list at + mailman-users-admin@python.org + +When replying, please edit your Subject line so it is more specific +than "Re: Contents of Mailman-Users digest..." + + +--10.0.11.1.506.27298.1035738004.364.17787 +Content-type: text/plain; charset=us-ascii +Content-description: Today's Topics (14 msgs) + +Today's Topics: + + 1. RELEASED Mailman 2.1 beta 4 (Barry A. Warsaw) + 2. bin/arch not working (Aparajita Fishman) + 3. Can't receive mail (Aparajita Fishman) + 4. I have the same problem with the list not sending mail..but + getting confirmations... (jared sanders) + 5. Re: RELEASED Mailman 2.1 beta 4 (Jeremy Portzer) + 6. Re: I have the same problem with the list not sending mail..but getting confirmations... (Aparajita Fishman) + 7. 2.1b4 problem (Fuzzy) + 8. inetd doesn't start mailman...? (Nick Arnett) + 9. Re: rejecting non-subscriber postings (G. Armour Van Horn) + 10. Re: No public lists? (Armando Soto Baeza) + 11. Re: No public lists? (Armando Soto Baeza) + 12. Re: I have the same problem with the list not sending mail..but getting confirmations... (Armando Soto Baeza) + 13. Re: Can't subscribe via web (Armando Soto Baeza) + +--10.0.11.1.506.27298.1035738004.364.17787 +Content-type: multipart/digest; boundary="__--__--" + +--__--__-- + +Message: 1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Message-ID: <15802.52753.139705.927733@gargle.gargle.HOWL> +---- MESSAGE TRUNCATED ---- + diff --git a/tests/bounces/dsn_11.txt b/tests/bounces/dsn_11.txt new file mode 100644 index 000000000..f3e8acaa7 --- /dev/null +++ b/tests/bounces/dsn_11.txt @@ -0,0 +1,176 @@ +Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) +From: Mail Delivery Subsystem <MAILER-DAEMON@example.com> +Message-Id: <200210261300.WAA27079@example.com> +To: <mailman-developers-bounces@python.org> +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="WAA27079.1035637226/example.com" +Subject: Returned mail: User unknown +Auto-Submitted: auto-generated (failure) +X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) +X-Spam-Status: No, hits=-4.0 required=5.0 + tests=ATTACH_DS,FAILURE_NOTICE_1,FAILURE_NOTICE_2,FROM_MAILER_DAEMON,MAILER_DAEMON,RCVD_IN_RFCI,SPAM_PHRASE_00_01 +X-Spam-Level: + +This is a MIME-encapsulated message + +--WAA27079.1035637226/example.com + +The original message was received at Sat, 26 Oct 2002 22:00:24 +0900 (JST) +from mailhub-nyc3-hme0.ny.ssmb.com [162.124.148.17] + + ----- The following addresses had permanent fatal errors ----- +<joem@example.com> +joem@example.com + (expanded from: <joem@example.com>) +joem@example.com + (expanded from: joem@example.com) +joem@example.com + (expanded from: joem@example.com) +joem@example.com + (expanded from: joem@example.com) +joem@example.com + (expanded from: joem@example.com) +joem@example.com + (expanded from: joem@example.com) +joem@example.com + (expanded from: joem@example.com) +joem@example.com + (expanded from: joem@example.com) +joem@example.com + (expanded from: joem@example.com) +joem@example.com + (expanded from: joem@example.com) + + ----- Transcript of session follows ----- +554 joem@example.com... aliasing/forwarding loop broken (11 aliases deep; 10 max) +550 joem@example.com... User unknown +550 joem@example.com... User unknown +550 joem@example.com... User unknown +550 joem@example.com... User unknown +550 joem@example.com... User unknown +550 joem@example.com... User unknown +550 joem@example.com... User unknown +550 joem@example.com... User unknown +550 joem@example.com... User unknown +550 joem@example.com... User unknown +550 <joem@example.com>... User unknown + +--WAA27079.1035637226/example.com +Content-Type: message/delivery-status + +Reporting-MTA: dns; example.com +Received-From-MTA: DNS; mailhub-nyc3-hme0.ny.ssmb.com +Arrival-Date: Sat, 26 Oct 2002 22:00:24 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +Final-Recipient: RFC822; <joem@example.com> +X-Actual-Recipient: RFC822; joem@example.com +Action: failed +Status: 5.1.1 +Last-Attempt-Date: Sat, 26 Oct 2002 22:00:26 +0900 (JST) + +--WAA27079.1035637226/example.com +Content-Type: text/rfc822-headers + +Return-Path: <mailman-developers-bounces@python.org> +Received: from mailhub-nyc3.ny.ssmb.com (mailhub-nyc3-hme0.ny.ssmb.com [162.124.148.17]) + by example.com (8.8.8+Sun/8.8.8) with ESMTP id WAA27077 + for <joem@example.com>; Sat, 26 Oct 2002 22:00:24 +0900 (JST) +Received: from imbarc-nj01.nj.ssmb.com (imbarc-nj01-1.nj.ssmb.com [150.110.115.169]) + by mailhub-nyc3.ny.ssmb.com (8.9.3/8.9.3/SSMB-HUB) with ESMTP id JAA01226 + for <joem@example.com>; Sat, 26 Oct 2002 09:00:23 -0400 (EDT) +Received: from imbavirus-nj02.nj.ssmb.com (imbavirus-nj02-1.nj.ssmb.com [150.110.235.232]) + by imbarc-nj01.nj.ssmb.com (8.12.4/8.12.4/SSMB_QQQ_IN/1.1) with ESMTP id g9QD0ZtR020988 + for <joem@example.com>; Sat, 26 Oct 2002 09:00:35 -0400 (EDT) +Received: (from uucp@localhost) + by imbavirus-nj02.nj.ssmb.com (8.11.0/8.11.0/SSMB_AV/1.1) id g9QD0GF15020 + for <joem@example.com>; Sat, 26 Oct 2002 09:00:16 -0400 (EDT) +Received: from nodnsquery(199.67.177.248) by imbavirus-nj02.nj.ssmb.com via csmap (V4.1) + id srcAAA5gaqvD; Sat, 26 Oct 02 09:00:15 -0400 +Received: from mail.python.org (mail.python.org [12.155.117.29]) + by imbaspam-nj04.iplex.ssmb.com (8.12.5/8.12.5/SSMB_EXT/evision: 1.13 $) with ESMTP id g9QD0FnI008045 + for <joem@example.com>; Sat, 26 Oct 2002 09:00:15 -0400 (EDT) +Received: from localhost.localdomain ([127.0.0.1] helo=mail.python.org) + by mail.python.org with esmtp (Exim 4.05) + id 185QXq-0004y2-00 + for joem@example.com; Sat, 26 Oct 2002 09:00:02 -0400 +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +From: mailman-developers-request@python.org +To: joem@example.com +Subject: confirm e70bc3961da9f415027185c8634596f7b226815a +Message-ID: <mailman.0.1035637201.19036.mailman-developers@python.org> +Date: Sat, 26 Oct 2002 09:00:01 -0400 +Precedence: bulk +X-BeenThere: mailman-developers@python.org +X-Mailman-Version: 2.1b4 +X-List-Administrivia: yes +List-Id: GNU Mailman developers <mailman-developers.python.org> +Sender: mailman-developers-bounces@python.org +Errors-To: mailman-developers-bounces@python.org +X-Spam-Score: -1.1 () NO_REAL_NAME +X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) + +--WAA27079.1035637226/example.com-- + + diff --git a/tests/onebounce.py b/tests/onebounce.py new file mode 100755 index 000000000..24467342e --- /dev/null +++ b/tests/onebounce.py @@ -0,0 +1,94 @@ +#! /usr/bin/env python + +# Copyright (C) 2002 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 +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +"""Test the bounce detection for files containing bounces. + +Usage: %(PROGRAM)s [options] file1 ... + +Options: + -h / --help + Print this text and exit. + + -v / --verbose + Verbose output. + + -a / --all + Run the message through all the bounce modules. Normally this script + stops at the first one that finds a match. +""" + +import sys +import email +import getopt + +import paths +from Mailman.Bouncers import BouncerAPI + +PROGRAM = sys.argv[0] +COMMASPACE = ', ' + + + +def usage(code, msg=''): + print __doc__ % globals() + if msg: + print msg + sys.exit(code) + + + +def main(): + try: + opts, args = getopt.getopt(sys.argv[1:], 'hva', + ['help', 'verbose', 'all']) + except getopt.error, msg: + usage(1, msg) + + all = verbose = 0 + for opt, arg in opts: + if opt in ('-h', '--help'): + usage(0) + elif opt in ('-v', '--verbose'): + verbose = 1 + elif opt in ('-a', '--all'): + all = 1 + + for file in args: + fp = open(file) + msg = email.message_from_file(fp) + fp.close() + for module in BouncerAPI.BOUNCE_PIPELINE: + modname = 'Mailman.Bouncers.' + module + __import__(modname) + addrs = sys.modules[modname].process(msg) + if addrs is BouncerAPI.Stop: + print module, 'got a Stop' + if not all: + break + if not addrs: + if verbose: + print module, 'found no matches' + else: + print module, 'found', COMMASPACE.join(addrs) + if not all: + break + + + +if __name__ == '__main__': + main() |
