Subject: | Another user unknown case |
Another user unknown case.
Patch attached, or see gitorious rep http://gitorious.org/mail-
deliverystatus-bounceparser-fork/mail-deliverystatus-bounceparser-
fork/commit/398258ad38a6d34511d7c887def2c4fbf14c6646
Subject: | 0001-Add-a-new-user-unknown-case.patch |
From 398258ad38a6d34511d7c887def2c4fbf14c6646 Mon Sep 17 00:00:00 2001
From: Michael Stevens <mstevens@etla.org>
Date: Mon, 7 Feb 2011 14:05:13 +0000
Subject: [PATCH] Add a new user unknown case
---
MANIFEST | 1 +
lib/Mail/DeliveryStatus/BounceParser.pm | 3 +-
t/corpus/user-unknown-disabled.msg | 101 +++++++++++++++++++++++++++++++
t/various-unknown.t | 6 ++-
4 files changed, 109 insertions(+), 2 deletions(-)
create mode 100644 t/corpus/user-unknown-disabled.msg
diff --git a/MANIFEST b/MANIFEST
index 6dcd6b2..bbe607e 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -102,6 +102,7 @@ t/corpus/whitelist.msg
t/corpus/rcpthosts.msg
t/corpus/rcpt-dne.msg
t/corpus/user-unknown-dne.msg
+t/corpus/user-unknown-disabled.msg
t/autoreply.t
t/email_addr_regex.t
t/iis-multiple-bounce.t
diff --git a/lib/Mail/DeliveryStatus/BounceParser.pm b/lib/Mail/DeliveryStatus/BounceParser.pm
index a483349..4ebe778 100644
--- a/lib/Mail/DeliveryStatus/BounceParser.pm
+++ b/lib/Mail/DeliveryStatus/BounceParser.pm
@@ -989,7 +989,8 @@ sub _std_reason {
/Recipient\s+does\s+not\s+exist\s+on\s+this\s+system/i or
/user\s+mail-box\s+not\s+found/i or
/No\s+mail\s+box\s+available\s+for\s+this\s+user/i or
- /User\s+\[\S+\]\s+does\s+not\s+exist/i
+ /User\s+\[\S+\]\s+does\s+not\s+exist/i or
+ /email\s+account\s+that\s+you\s+tried\s+to\s+reach\s+is\s+disabled/i
) {
return "user_unknown";
}
diff --git a/t/corpus/user-unknown-disabled.msg b/t/corpus/user-unknown-disabled.msg
new file mode 100644
index 0000000..b05e23c
--- /dev/null
+++ b/t/corpus/user-unknown-disabled.msg
@@ -0,0 +1,101 @@
+Delivered-To: automated-bounces+5b805f96-32a1-11e0-a4c9-eb3b278a9227@email.example.com
+Received: by 10.100.190.1 with SMTP id n1cs37359anf;
+ Mon, 7 Feb 2011 02:02:24 -0800 (PST)
+Received: by 10.227.151.65 with SMTP id b1mr1642791wbw.163.1297072943515;
+ Mon, 07 Feb 2011 02:02:23 -0800 (PST)
+Return-Path: <>
+Received: from admin1.example.co.uk (admin1.example.co.uk [94.236.45.212])
+ by mx.google.com with ESMTP id f25si6044788wbf.55.2011.02.07.02.02.23;
+ Mon, 07 Feb 2011 02:02:23 -0800 (PST)
+Received-SPF: pass (google.com: best guess record for domain of admin1.example.co.uk designates 94.236.45.212 as permitted sender) client-ip=94.236.45.212;
+Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of admin1.example.co.uk designates 94.236.45.212 as permitted sender) smtp.mail=
+Received: by admin1.example.co.uk (Postfix)
+ id EF728650D72; Mon, 7 Feb 2011 10:02:22 +0000 (GMT)
+Date: Mon, 7 Feb 2011 10:02:22 +0000 (GMT)
+From: MAILER-DAEMON@admin1.example.co.uk (Mail Delivery System)
+Subject: Undelivered Mail Returned to Sender
+To: automated-bounces+5B805F96-32A1-11E0-A4C9-EB3B278A9227@email.example.com
+Auto-Submitted: auto-replied
+MIME-Version: 1.0
+Content-Type: multipart/report; report-type=delivery-status;
+ boundary="C8039650D70.1297072942/admin1.example.co.uk"
+Content-Transfer-Encoding: 8bit
+Message-Id: <20110207100222.EF728650D72@admin1.example.co.uk>
+
+This is a MIME-encapsulated message.
+
+--C8039650D70.1297072942/admin1.example.co.uk
+Content-Description: Notification
+Content-Type: text/plain; charset=us-ascii
+
+This is the mail system at host admin1.example.co.uk.
+
+I'm sorry to have to inform you that your message could not
+be delivered to one or more recipients. It's attached below.
+
+For further assistance, please send mail to <postmaster>
+
+If you do so, please include this problem report. You can
+delete your own text from the attached returned message.
+
+ The mail system
+
+<recipient@example.net>: host aspmx.l.google.com[209.85.227.27] said: 550 5.2.1
+ The email account that you tried to reach is disabled. t11si6005099wes.103
+ (in reply to RCPT TO command)
+
+--C8039650D70.1297072942/admin1.example.co.uk
+Content-Description: Delivery report
+Content-Type: message/delivery-status
+
+Reporting-MTA: dns; admin1.example.co.uk
+X-Postfix-Queue-ID: C8039650D70
+X-Postfix-Sender: rfc822; automated-bounces+5B805F96-32A1-11E0-A4C9-EB3B278A9227@email.example.com
+Arrival-Date: Mon, 7 Feb 2011 10:02:22 +0000 (GMT)
+
+Final-Recipient: rfc822; recipient@example.net
+Action: failed
+Status: 5.2.1
+Remote-MTA: dns; aspmx.l.google.com
+Diagnostic-Code: smtp; 550 5.2.1 The email account that you tried to reach is
+ disabled. t11si6005099wes.103
+
+--C8039650D70.1297072942/admin1.example.co.uk
+Content-Description: Undelivered Message
+Content-Type: message/rfc822
+Content-Transfer-Encoding: 8bit
+
+Received: by admin1.example.co.uk (Postfix, from userid 507)
+ id C8039650D70; Mon, 7 Feb 2011 10:02:22 +0000 (GMT)
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: multipart/alternative; boundary="_----------=_129707294257417"
+X-Mailer: MIME::Lite 3.027 (F2.78; T1.31; A2.07; B3.13; Q3.13)
+Date: Mon, 7 Feb 2011 10:02:22 +0000
+From: Julia Stevens <julia.stevens@email.example.com>
+Subject: test
+X-Campaignid: example20101008.1
+List-Unsubscribe: <http://www.exampleoffers.co.uk/unsubscribe.epl?uuid=5B805F96-32A1-11E0-A4C9-EB3B278A9227>
+To: Fred Bloggs <recipient@example.net>
+Message-Id: <20110207100222.C8039650D70@admin1.example.co.uk>
+
+This is a multi-part message in MIME format.
+
+--_----------=_129707294257417
+Content-Disposition: inline
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain
+
+Text
+
+--_----------=_129707294257417
+Content-Disposition: inline
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html
+
+HTML
+
+--_----------=_129707294257417--
+
+
+--C8039650D70.1297072942/admin1.example.co.uk--
diff --git a/t/various-unknown.t b/t/various-unknown.t
index 3edb149..cf7fac1 100644
--- a/t/various-unknown.t
+++ b/t/various-unknown.t
@@ -2,7 +2,7 @@
use strict;
# Add 6 to this for each case you add to %files_and_responses
-use Test::More tests => 156;
+use Test::More tests => 162;
use Mail::DeliveryStatus::BounceParser;
@@ -152,6 +152,10 @@ This is a permanent error; I've given up. Sorry it didn't work out.",
"reason" => "550 Recipient does not exist",
"smtp_code" => "550",
},
+ "user-unknown-disabled.msg" => {
+ "reason" => "550 5.2.1 The email account that you tried to reach is disabled. t11si6005099wes.103",
+ "smtp_code" => "550",
+ },
);
foreach my $file (keys %files_and_responses) {
--
1.7.1