diff options
author | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2017-02-15 17:35:23 +0900 |
---|---|---|
committer | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2017-02-15 17:35:23 +0900 |
commit | 593d91698db3fa9dd99b64f2973ee14947dd4782 (patch) | |
tree | 00fa54270be0043ccb74614df7321816c6facc76 | |
parent | ee5b57e4bc8fdca687cbc04a1338941941f29b1d (diff) | |
parent | c78ea26f8f04cd2e3d2cf231736bcc95ec8cccd5 (diff) | |
download | mailman2-593d91698db3fa9dd99b64f2973ee14947dd4782.tar.gz mailman2-593d91698db3fa9dd99b64f2973ee14947dd4782.tar.xz mailman2-593d91698db3fa9dd99b64f2973ee14947dd4782.zip |
Merge lp:mailman/2.1 up to 1691
Diffstat (limited to '')
-rw-r--r-- | Mailman/Bouncers/SimpleMatch.py | 4 | ||||
-rw-r--r-- | Mailman/Cgi/roster.py | 6 | ||||
-rw-r--r-- | Mailman/Queue/BounceRunner.py | 34 | ||||
-rw-r--r-- | NEWS | 8 | ||||
-rw-r--r-- | tests/bounces/simple_41.txt | 47 | ||||
-rwxr-xr-x | tests/test_bounces.py | 3 |
6 files changed, 85 insertions, 17 deletions
diff --git a/Mailman/Bouncers/SimpleMatch.py b/Mailman/Bouncers/SimpleMatch.py index 2aa082a2..e84d2255 100644 --- a/Mailman/Bouncers/SimpleMatch.py +++ b/Mailman/Bouncers/SimpleMatch.py @@ -188,6 +188,10 @@ PATTERNS = [ (_c('A message that you sent was rejected'), _c('This is a copy of your message'), _c('\s(?P<addr>[^\s@]+@[^\s@]+)')), + # MailEnable + (_c('Message could not be delivered to some recipients.'), + _c('Message headers follow'), + _c('Recipient: \[SMTP:(?P<addr>[^\s@]+@[^\s@]+)\]')), # Next one goes here... ] diff --git a/Mailman/Cgi/roster.py b/Mailman/Cgi/roster.py index e9ab03c1..cb6847af 100644 --- a/Mailman/Cgi/roster.py +++ b/Mailman/Cgi/roster.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2017 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 @@ -141,8 +141,8 @@ def error_page(errmsg): print doc.Format() -def error_page_doc(doc, errmsg, *args): +def error_page_doc(doc, errmsg): # Produce a simple error-message page on stdout and exit. doc.SetTitle(_("Error")) doc.AddItem(Header(2, _("Error"))) - doc.AddItem(Bold(errmsg % args)) + doc.AddItem(Bold(errmsg)) diff --git a/Mailman/Queue/BounceRunner.py b/Mailman/Queue/BounceRunner.py index 651039d6..2d14f284 100644 --- a/Mailman/Queue/BounceRunner.py +++ b/Mailman/Queue/BounceRunner.py @@ -29,6 +29,7 @@ from email.Utils import parseaddr from Mailman import mm_cfg from Mailman import Utils from Mailman import LockFile +from Mailman.Errors import NotAMemberError from Mailman.Message import UserNotification from Mailman.Bouncer import _BounceInfo from Mailman.Bouncers import BouncerAPI @@ -151,19 +152,26 @@ class BounceMixin: mlist.Lock() try: op, addr, bmsg = mlist.pend_confirm(token) - info = mlist.getBounceInfo(addr) - if not info: - # info was deleted before probe bounce was received. - # Just create a new info. - info = _BounceInfo(addr, - 0.0, - time.localtime()[:3], - mlist.bounce_you_are_disabled_warnings - ) - mlist.disableBouncingMember(addr, info, bmsg) - # Only save the list if we're unlocking it - if not locked: - mlist.Save() + # For Python 2.4 compatibility we need an inner try because + # try: ... except: ... finally: requires Python 2.5+ + try: + info = mlist.getBounceInfo(addr) + if not info: + # info was deleted before probe bounce was received. + # Just create a new info. + info = _BounceInfo(addr, + 0.0, + time.localtime()[:3], + mlist.bounce_you_are_disabled_warnings + ) + mlist.disableBouncingMember(addr, info, bmsg) + # Only save the list if we're unlocking it + if not locked: + mlist.Save() + except NotAMemberError: + # Member was removed before probe bounce returned. + # Just ignore it. + pass finally: if not locked: mlist.Unlock() @@ -26,6 +26,14 @@ Here is a history of user visible changes to Mailman. Bug fixes and other patches + - Added recognition for a newly seen mailEnable bounce. + + - Fixed an uncaught NotAMemberError when a member is removed before a + probe bounce for the member is returned. (LP: #1664729) + + - Fixed a TypeError thrown in the roster CGI when called with a listname + containing a % character. (LP: #1661810) + - Fixed a NameError issue in bin/add_members with DISABLE_COMMAND_LOCALE_CSET = yes. (LP: #1647450) diff --git a/tests/bounces/simple_41.txt b/tests/bounces/simple_41.txt new file mode 100644 index 00000000..60cbe46c --- /dev/null +++ b/tests/bounces/simple_41.txt @@ -0,0 +1,47 @@ +Received: from intercitytime.com (unknown [218.255.171.146]) + by mail.mailman3.org (Postfix) with ESMTP id 7675880267 + for <mailman-users-bounces@mailman3.org>; Tue, 14 Feb 2017 09:29:16 +0000 (UTC) +From: "Delivery Subsystem" <POSTMASTER@intercitytime.com> +To: <mailman-users-bounces@mailman3.org> +Subject: Message Delivery Failure +Date: Tue, 14 Feb 2017 17:29:12 +0800 +Message-ID: <BD6CB5FA118F4A91B33FFF4DEF67E03E.MAI@intercitytime.com> +X-MEFilter: 1 +Precedence: bulk +Auto-Submitted: auto-replied +Message-ID-Hash: QD4JEJZEMX3L2YZ3EPVXIXH2QNFQ5Z7D +X-Message-ID-Hash: QD4JEJZEMX3L2YZ3EPVXIXH2QNFQ5Z7D +X-MailFrom: <> + + +MailEnable: Message could not be delivered to some recipients. +The following recipient(s) could not be reached: + + Recipient: [SMTP:jeff.chan@intercitytime.com] + Reason: Remote SMTP Server Returned: 550 Requested action not taken: mailbox unavailable or not local. + + +Message headers follow: + +Received: with MailEnable Postoffice Connector; Tue, 14 Feb 2017 17:29:09 +0800 +Received: from mail.mailman3.org ([104.239.228.201]) by intercitytime.com with MailEnable ESMTP; Tue, 14 Feb 2017 17:29:08 +0800 +Received: from mailman.iad1.psf.io (ip6-localhost [127.0.0.1]) + by mail.mailman3.org (Postfix) with ESMTP id 468CC80267 + for <free-trial@intercitytime.com>; Tue, 14 Feb 2017 09:29:08 +0000 (UTC) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailman3.org; + s=default; t=1487064548; + bh=aulHL7gMEucDw5WDL8d6/+CPIEzXORHWiObo1NS4HuE=; + h=Subject:From:To:Date; + b=uGQifVlhvVfe2PWe+A8qsiVzSXpFho30W6YE8OEIX5ql3vSxPQURW9rpD/GjVI0sR + nt09YhHzwh0Df7NvwNMa6uHIZaGGOMSpWd2irIj+onwOi8di4yoFK4r/JQjBr4PZ7n + v/X846uBX3c8rKnAg8h6qTSb6dI5xziORKlgh1B4= +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: 7bit +Subject: Your message to mailman-users@mailman3.org awaits moderator approval +From: mailman-users-bounces@mailman3.org +To: free-trial@intercitytime.com +Message-ID: <20170214092907.10185.42474@mailman.iad1.psf.io> +Date: Tue, 14 Feb 2017 09:29:07 +0000 +Precedence: bulk +X-Mailman-Version: 3.1.0b4 diff --git a/tests/test_bounces.py b/tests/test_bounces.py index 8c33ccfd..082e9a99 100755 --- a/tests/test_bounces.py +++ b/tests/test_bounces.py @@ -80,7 +80,8 @@ class BounceTest(unittest.TestCase): ('SimpleMatch', 'simple_36.txt', ['garyt@xxx.com']), ('SimpleMatch', 'simple_37.txt', ['user@uci.edu']), ('SimpleMatch', 'simple_38.txt', ['prueba@domain.com']), - ('SimpleMatch', 'simple_39.txt', [b'foo@mail.ru']), + ('SimpleMatch', 'simple_39.txt', ['foo@mail.ru']), + ('SimpleMatch', 'simple_41.txt', ['jeff.chan@intercitytime.com']), ('SimpleMatch', 'bounce_02.txt', ['acinsp1@midsouth.rr.com']), ('SimpleMatch', 'bounce_03.txt', ['james@jeborall.demon.co.uk']), # SimpleWarning |