aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2020-12-18 12:04:50 -0800
committerMark Sapiro <mark@msapiro.net>2020-12-18 12:04:50 -0800
commit66778c53a61f9c09fa5d1c7bb3d2e8866f8a246c (patch)
tree425128fdcdbbd5c7708dc20b8ddf0e43eb57b361
parent9dd4dc9131506dff9dd8744b254b69f15d1a729c (diff)
downloadmailman2-66778c53a61f9c09fa5d1c7bb3d2e8866f8a246c.tar.gz
mailman2-66778c53a61f9c09fa5d1c7bb3d2e8866f8a246c.tar.xz
mailman2-66778c53a61f9c09fa5d1c7bb3d2e8866f8a246c.zip
Added recognition for a non-compliant DSN from an unknown MTA.
Diffstat (limited to '')
-rw-r--r--Mailman/Bouncers/SimpleMatch.py4
-rw-r--r--tests/bounces/simple_44.txt28
-rw-r--r--tests/test_bounces.py1
3 files changed, 33 insertions, 0 deletions
diff --git a/Mailman/Bouncers/SimpleMatch.py b/Mailman/Bouncers/SimpleMatch.py
index 6de9a858..b7889d21 100644
--- a/Mailman/Bouncers/SimpleMatch.py
+++ b/Mailman/Bouncers/SimpleMatch.py
@@ -199,6 +199,10 @@ PATTERNS = [
(_c(r'wasn\'t able to deliver the following message'),
_c(r'---Below this line is a copy of the message.'),
_c(r'To: (?P<addr>[^\s@]+@[^\s@]+)')),
+ # From some unknown MTA
+ (_c(r'This is a delivery failure notification message'),
+ _c(r'The problem appears to be'),
+ _c(r'-- (?P<addr>[^\s@]+@[^\s@]+)')),
# Next one goes here...
]
diff --git a/tests/bounces/simple_44.txt b/tests/bounces/simple_44.txt
new file mode 100644
index 00000000..832ca5f9
--- /dev/null
+++ b/tests/bounces/simple_44.txt
@@ -0,0 +1,28 @@
+Subject: [Postmaster] Email Delivery Failure
+Message-Id: <111195647-1608276241173@example.com>
+Date: Fri, 18 Dec 2020 09:24:01 +0200
+From: "Mail Delivery System" <mailer-daemon@example.com>
+To: "dns-operations" <dns-operations-bounces@example.net>
+X-Mimecast-Originator: <>
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+X-MIME-Autoconverted: from quoted-printable to 8bit by example.net id 0BI7O1sk026573
+
+This is a delivery failure notification message indicating that
+an email dns-operations-bounces@example.net addressed to email address :
+-- user@example.com
+
+With subject Re: [dns-operations] Monitoring for impending expiration of domains? sent on the Mon, 14 Dec 2020 11:30:37 +0100 (CET)
+could not be delivered. The problem appears to be :
+-- Recipient server unavailable or busy
+
+Additional information follows :
+-- 4.4.4 Temporary server error. Please try again later ATTR5 [VE1EUR02FT049.eop-EUR02.prod.protection.outlook.com]
+
+This condition occurred after 30 attempt(s) to deliver over
+a period of 92 hour(s) and 52 minute(s).
+
+If you sent the email to multiple recipients, you will receive one
+of these messages for each one which failed delivery, otherwise
+they have been sent.
+
diff --git a/tests/test_bounces.py b/tests/test_bounces.py
index 3ddde6b6..78527f8b 100644
--- a/tests/test_bounces.py
+++ b/tests/test_bounces.py
@@ -82,6 +82,7 @@ class BounceTest(unittest.TestCase):
('SimpleMatch', 'simple_38.txt', ['userx@example.com']),
('SimpleMatch', 'simple_39.txt', ['userx@example.ru']),
('SimpleMatch', 'simple_41.txt', ['userx@example.com']),
+ ('SimpleMatch', 'simple_44.txt', ['user@example.com']),
('SimpleMatch', 'bounce_02.txt', ['userx@example.com']),
('SimpleMatch', 'bounce_03.txt', ['userx@example.uk']),
('SimpleMatch', 'yahoo_12.txt', ['user@yahoo.com']),