Subject: | Yet Another User Unknown Case |
Yet another user unknown case.
Patch attached or in gitorious at:
http://gitorious.org/mail-deliverystatus-bounceparser-fork/mail-
deliverystatus-bounceparser-
fork/commit/4657130ee23dcb34e709c27670c9e9f445f08a6d
Subject: | 0001-Another-user-unknown-case.patch |
From 4657130ee23dcb34e709c27670c9e9f445f08a6d Mon Sep 17 00:00:00 2001
From: Michael Stevens <mstevens@etla.org>
Date: Mon, 7 Feb 2011 14:41:31 +0000
Subject: [PATCH] Another user unknown case
---
MANIFEST | 1 +
lib/Mail/DeliveryStatus/BounceParser.pm | 3 +-
t/corpus/user-unknown-not-active.msg | 99 +++++++++++++++++++++++++++++++
t/various-unknown.t | 6 ++-
4 files changed, 107 insertions(+), 2 deletions(-)
create mode 100644 t/corpus/user-unknown-not-active.msg
diff --git a/MANIFEST b/MANIFEST
index bbe607e..6b094a2 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -103,6 +103,7 @@ t/corpus/rcpthosts.msg
t/corpus/rcpt-dne.msg
t/corpus/user-unknown-dne.msg
t/corpus/user-unknown-disabled.msg
+t/corpus/user-unknown-not-active.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 4ebe778..e51ffa5 100644
--- a/lib/Mail/DeliveryStatus/BounceParser.pm
+++ b/lib/Mail/DeliveryStatus/BounceParser.pm
@@ -990,7 +990,8 @@ sub _std_reason {
/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 or
- /email\s+account\s+that\s+you\s+tried\s+to\s+reach\s+is\s+disabled/i
+ /email\s+account\s+that\s+you\s+tried\s+to\s+reach\s+is\s+disabled/i or
+ /not\s+an\s+active\s+address\s+at\s+this\s+host/i
) {
return "user_unknown";
}
diff --git a/t/corpus/user-unknown-not-active.msg b/t/corpus/user-unknown-not-active.msg
new file mode 100644
index 0000000..a449f02
--- /dev/null
+++ b/t/corpus/user-unknown-not-active.msg
@@ -0,0 +1,99 @@
+Delivered-To: automated-bounces+44afd5ce-3154-11e0-aabe-91da7d10784c@email.example.com
+Received: by 10.100.190.1 with SMTP id n1cs61337anf;
+ Sat, 5 Feb 2011 10:18:05 -0800 (PST)
+Received: by 10.216.3.3 with SMTP id 3mr668647weg.57.1296929884149;
+ Sat, 05 Feb 2011 10:18:04 -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 c5si3564974wer.11.2011.02.05.10.18.03;
+ Sat, 05 Feb 2011 10:18:04 -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 8A324154869D; Sat, 5 Feb 2011 18:18:03 +0000 (GMT)
+Date: Sat, 5 Feb 2011 18:18:03 +0000 (GMT)
+From: MAILER-DAEMON@admin1.example.co.uk (Mail Delivery System)
+Subject: Undelivered Mail Returned to Sender
+To: automated-bounces+44AFD5CE-3154-11E0-AABE-91DA7D10784C@email.example.com
+Auto-Submitted: auto-replied
+MIME-Version: 1.0
+Content-Type: multipart/report; report-type=delivery-status;
+ boundary="3BD40154869C.1296929883/admin1.example.co.uk"
+Message-Id: <20110205181803.8A324154869D@admin1.example.co.uk>
+
+This is a MIME-encapsulated message.
+
+--3BD40154869C.1296929883/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 mailspool.example.net[212.126.144.70] said:
+ 550-recipient@example.net is not an active address at this host (invalid FreeUK
+ 550 username) (in reply to RCPT TO command)
+
+--3BD40154869C.1296929883/admin1.example.co.uk
+Content-Description: Delivery report
+Content-Type: message/delivery-status
+
+Reporting-MTA: dns; admin1.example.co.uk
+X-Postfix-Queue-ID: 3BD40154869C
+X-Postfix-Sender: rfc822; automated-bounces+44AFD5CE-3154-11E0-AABE-91DA7D10784C@email.example.com
+Arrival-Date: Sat, 5 Feb 2011 18:18:02 +0000 (GMT)
+
+Final-Recipient: rfc822; recipient@example.net
+Action: failed
+Status: 5.0.0
+Remote-MTA: dns; mailspool.example.net
+Diagnostic-Code: smtp; 550-recipient@example.net is not an active address at this
+ host (invalid FreeUK 550 username)
+
+--3BD40154869C.1296929883/admin1.example.co.uk
+Content-Description: Undelivered Message
+Content-Type: message/rfc822
+
+Received: by admin1.example.co.uk (Postfix, from userid 507)
+ id 3BD40154869C; Sat, 5 Feb 2011 18:18:02 +0000 (GMT)
+DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=email.example.com;
+ s=default10; t=1296929882;
+ bh=Eu7KYwW3JmGr7HUk/SLx9vTkp9fx1l2BvLaPXD6j5h8=;
+ h=MIME-Version:Content-Transfer-Encoding:Content-Type:Date:From:
+ Subject:List-Unsubscribe:To:Message-Id;
+ b=J/0lbp+AhxdUoDN6YKcXKQoLaJsKiHkPAs06X7N0H1t7Qc+i0r67YQgm3vHv5repO
+ tPjjN7jptdcy6Ui/Tq+302I6VCwZcTW2cVKB78lapC0yLdYgbkgZBWtVz02vcb313k
+ N8rb0/S5fpCaMUqZPFfh67aklPEVOuKF+noyzNxk=
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: multipart/related; boundary="_----------=_1296929882195560"
+X-Mailer: MIME::Lite 3.027 (F2.78; T1.31; A2.07; B3.13; Q3.13)
+Date: Sat, 5 Feb 2011 18:18:02 +0000
+From: Julia Stevens <julia.stevens@email.example.com>
+Subject: foo
+List-Unsubscribe: <http://www.exampleoffers.co.uk/unsubscribe.epl?uuid=44AFD5CE-3154-11E0-AABE-91DA7D10784C>
+To: Fred Bloggs <recipient@example.net>
+Message-Id: <20110205181802.3BD40154869C@admin1.example.co.uk>
+
+This is a multi-part message in MIME format.
+
+--_----------=_1296929882195560
+Content-Disposition: inline
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html
+
+HTMl goes here.
+
+--_----------=_1296929882195560--
+
+
+--3BD40154869C.1296929883/admin1.example.co.uk--
diff --git a/t/various-unknown.t b/t/various-unknown.t
index cf7fac1..b1f2c90 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 => 162;
+use Test::More tests => 168;
use Mail::DeliveryStatus::BounceParser;
@@ -156,6 +156,10 @@ This is a permanent error; I've given up. Sorry it didn't work out.",
"reason" => "550 5.2.1 The email account that you tried to reach is disabled. t11si6005099wes.103",
"smtp_code" => "550",
},
+ "user-unknown-not-active.msg" => {
+ "reason" => '550-recipient@example.net is not an active address at this host (invalid FreeUK 550 username)',
+ "smtp_code" => "550",
+ },
);
foreach my $file (keys %files_and_responses) {
--
1.7.1