aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2018-11-28 12:03:48 -0800
committerMark Sapiro <mark@msapiro.net>2018-11-28 12:03:48 -0800
commitd03507def644416adf753098173220be6f75c137 (patch)
treeeebbc55005d36568469a1f43103e08ed43978fb5
parent377a75049a8b1bccf352e1347e2c4a02e7dd6170 (diff)
downloadmailman2-d03507def644416adf753098173220be6f75c137.tar.gz
mailman2-d03507def644416adf753098173220be6f75c137.tar.xz
mailman2-d03507def644416adf753098173220be6f75c137.zip
Added recognition for non-compliant opensmtpd DSN Action: error.
-rw-r--r--Mailman/Bouncers/DSN.py3
-rw-r--r--NEWS3
-rw-r--r--tests/bounces/dsn_18.txt52
-rw-r--r--tests/test_bounces.py1
4 files changed, 58 insertions, 1 deletions
diff --git a/Mailman/Bouncers/DSN.py b/Mailman/Bouncers/DSN.py
index 701617db..b316c696 100644
--- a/Mailman/Bouncers/DSN.py
+++ b/Mailman/Bouncers/DSN.py
@@ -56,7 +56,8 @@ def check(msg):
# Some MTAs have been observed that put comments on the action.
if action.startswith('delayed'):
return Stop
- if not action.startswith('fail'):
+ # opensmtpd uses non-compliant Action: error.
+ if not (action.startswith('fail') or action.startswith('error')):
# Some non-permanent failure, so ignore this block
continue
params = []
diff --git a/NEWS b/NEWS
index 6efcfd0e..da907746 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,9 @@ Here is a history of user visible changes to Mailman.
- Scrubbed application/octet-stream MIME parts will now be given a
.bin extension instead of .obj.
+ - Added bounce recognition for a non-compliant opensmtpd DSN with
+ Action: error. (LP: #1805137)
+
2.1.29 (24-Jul-2018)
Bug Fixes
diff --git a/tests/bounces/dsn_18.txt b/tests/bounces/dsn_18.txt
new file mode 100644
index 00000000..f2988895
--- /dev/null
+++ b/tests/bounces/dsn_18.txt
@@ -0,0 +1,52 @@
+Return-Path: <>
+X-Original-To: list.name-bounces@domain.replaced
+Delivered-To: list.name-bounces@domain.replaced
+Received: from mx.domain.replaced (mx.domain.replaced [177.XXX.XXX.XXX])
+ by mailhost.domain.replaced (Postfix) with ESMTP id 6D6C71E8A3
+ for <list.name-bounces@domain.replaced>; Thu, 22 Nov 2018 17:56:08 -0200 (BRST)
+Received: from mx.domain.replaced (mx.domain.replaced [local])
+ by mx.domain.replaced (OpenSMTPD) with ESMTPA id cce9bd49
+ for <list.name-bounces@domain.replaced>;
+ Thu, 22 Nov 2018 17:56:08 -0200 (-02)
+Subject: Delivery status notification: error
+From: Mailer Daemon <MAILER-DAEMON@mx.domain.replaced>
+To: list.name-bounces@domain.replaced
+Date: Thu, 22 Nov 2018 17:56:08 -0200 (-02)
+MIME-Version: 1.0
+Content-Type: multipart/mixed;boundary="9950749020440539406/mx.domain.replaced"
+Message-ID: <f778c4a058120b20@mx.domain.replaced>
+
+This is a MIME-encapsulated message.
+
+--9950749020440539406/mx.domain.replaced
+Content-Description: Notification
+Content-Type: text/plain; charset=us-ascii
+
+ Hi!
+
+ This is the MAILER-DAEMON, please DO NOT REPLY to this email.
+
+ An error has occurred while attempting to deliver a message for
+ the following list of recipients:
+
+email@replaced.net: Domain does not exist
+
+ Below is a copy of the original message:
+
+--9950749020440539406/mx.domain.replaced
+Content-Description: Delivery Report
+Content-Type: message/delivery-status
+
+Reporting-MTA: dns; mx.domain.replaced
+
+Final-Recipient: rfc822; email@replaced.net
+Action: error
+Status: 5.0.0
+
+--9950749020440539406/mx.domain.replaced
+Content-Description: Message headers
+Content-Type: text/rfc822-headers
+
+[ORIGINAL MESSAGE]
+
+--9950749020440539406/mx.domain.replaced--
diff --git a/tests/test_bounces.py b/tests/test_bounces.py
index e9bcff17..2f814428 100644
--- a/tests/test_bounces.py
+++ b/tests/test_bounces.py
@@ -122,6 +122,7 @@ class BounceTest(unittest.TestCase):
('DSN', 'dsn_15.txt', ['userx@example.com']),
('DSN', 'dsn_16.txt', ['userx@example.com']),
('DSN', 'dsn_17.txt', Stop),
+ ('DSN', 'dsn_18.txt', ['email@replaced.net']),
# Microsoft Exchange
('Exchange', 'microsoft_01.txt', ['userx@example.COM']),
('Exchange', 'microsoft_02.txt', ['userx@example.COM']),