CC: | michael.stevens [...] dianomi.com,michael.smith [...] dianomi.com |
Subject: | Add another user unknown case |
Another user unknown case:
http://gitorious.org/mail-deliverystatus-bounceparser-fork/mail-
deliverystatus-bounceparser-
fork/commit/df6c32c02476a85d422c12f1d26d350bae92d143
Subject: | df6c32c02476a85d422c12f1d26d350bae92d143.patch.txt |
From df6c32c02476a85d422c12f1d26d350bae92d143 Mon Sep 17 00:00:00 2001
From: Michael Stevens <mstevens@etla.org>
Date: Thu, 9 Dec 2010 12:25:40 +0000
Subject: [PATCH] Another user unknown case.
---
MANIFEST | 1 +
lib/Mail/DeliveryStatus/BounceParser.pm | 2 +-
t/corpus/doesnotexist2.msg | 107 +++++++++++++++++++++++++++++++
t/various-unknown.t | 6 ++-
4 files changed, 114 insertions(+), 2 deletions(-)
create mode 100644 t/corpus/doesnotexist2.msg
diff --git a/MANIFEST b/MANIFEST
index 5789265..60a5bd1 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -31,6 +31,7 @@ t/corpus/cox-via-sendmail.unknown.msg
t/corpus/deactivated-mailbox.msg
t/corpus/domino.unknown.msg
t/corpus/doesnotexist.msg
+t/corpus/doesnotexist2.msg
t/corpus/exchange.unknown.msg
t/corpus/generic-postfix-via-sendmail.unknown.msg
t/corpus/gmail-via-sendmail.unknown.msg
diff --git a/lib/Mail/DeliveryStatus/BounceParser.pm b/lib/Mail/DeliveryStatus/BounceParser.pm
index db8881d..15e3aef 100644
--- a/lib/Mail/DeliveryStatus/BounceParser.pm
+++ b/lib/Mail/DeliveryStatus/BounceParser.pm
@@ -970,7 +970,7 @@ sub _std_reason {
/account not activated/i or # usa.net
/not\s+our\s+customer/i or # Comcast
/doesn't handle mail for that user/i or # mailfoundry
- /Address\s+does\s+not\s+exist/i or
+ /$user_re\s+does\s+not\s+exist/i or
/Recipient\s+<?$EMAIL_ADDR_REGEX>?\s+does\s+not\s+exist/i or
/recipient\s+no\s+longer\s+on\s+server/i or # me.com
/is\s+not\s+a\s+known\s+user\s+on\s+this\s+system/i or # cam.ac.uk
diff --git a/t/corpus/doesnotexist2.msg b/t/corpus/doesnotexist2.msg
new file mode 100644
index 0000000..c363987
--- /dev/null
+++ b/t/corpus/doesnotexist2.msg
@@ -0,0 +1,107 @@
+Delivered-To: automated-bounces+b847ed2c-01fd-11e0-9f31-e49dfbd33537@email.example2.com
+Received: by 10.216.139.130 with SMTP id c2cs241942wej;
+ Tue, 7 Dec 2010 04:30:06 -0800 (PST)
+Received: by 10.227.155.75 with SMTP id r11mr7172883wbw.123.1291725005756;
+ Tue, 07 Dec 2010 04:30:05 -0800 (PST)
+Return-Path: <>
+Received: from server4.example2.co.uk (server4.example2.co.uk [94.236.45.212])
+ by mx.google.com with ESMTP id h37si2029086wbh.86.2010.12.07.04.30.05;
+ Tue, 07 Dec 2010 04:30:05 -0800 (PST)
+Received-SPF: pass (google.com: best guess record for domain of server4.example2.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 server4.example2.co.uk designates 94.236.45.212 as permitted sender) smtp.mail=
+Received: by server4.example2.co.uk (Postfix)
+ id 7F0213D60008; Tue, 7 Dec 2010 12:30:05 +0000 (GMT)
+Date: Tue, 7 Dec 2010 12:30:05 +0000 (GMT)
+From: MAILER-DAEMON@server4.example2.co.uk (Mail Delivery System)
+Subject: Undelivered Mail Returned to Sender
+To: automated-bounces+B847ED2C-01FD-11E0-9F31-E49DFBD33537@email.example2.com
+Auto-Submitted: auto-replied
+MIME-Version: 1.0
+Content-Type: multipart/report; report-type=delivery-status;
+ boundary="31F623D60006.1291725005/server4.example2.co.uk"
+Content-Transfer-Encoding: 8bit
+Message-Id: <20101207123005.7F0213D60008@server4.example2.co.uk>
+
+This is a MIME-encapsulated message.
+
+--31F623D60006.1291725005/server4.example2.co.uk
+Content-Description: Notification
+Content-Type: text/plain; charset=us-ascii
+
+This is the mail system at host server4.example2.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 mxtls.expurgate.de[195.190.135.122] said:
+ 550 Recipient does not exist (in reply to RCPT TO command)
+
+--31F623D60006.1291725005/server4.example2.co.uk
+Content-Description: Delivery report
+Content-Type: message/delivery-status
+
+Reporting-MTA: dns; server4.example2.co.uk
+X-Postfix-Queue-ID: 31F623D60006
+X-Postfix-Sender: rfc822; automated-bounces+B847ED2C-01FD-11E0-9F31-E49DFBD33537@email.example2.com
+Arrival-Date: Tue, 7 Dec 2010 12:30:05 +0000 (GMT)
+
+Final-Recipient: rfc822; recipient@example.net
+Action: failed
+Status: 5.0.0
+Remote-MTA: dns; mxtls.expurgate.de
+Diagnostic-Code: smtp; 550 Recipient does not exist
+
+--31F623D60006.1291725005/server4.example2.co.uk
+Content-Description: Undelivered Message
+Content-Type: message/rfc822
+Content-Transfer-Encoding: 8bit
+
+Received: by server4.example2.co.uk (Postfix, from userid 505)
+ id 31F623D60006; Tue, 7 Dec 2010 12:30:05 +0000 (GMT)
+DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=email.example2.com;
+ s=default10; t=1291725005;
+ bh=HZ0HNbkwH25L51ue8bj4tpQtozbLRWMDC1QoekbZ1JA=;
+ h=MIME-Version:Content-Transfer-Encoding:Content-Type:Date:From:
+ Subject:List-Unsubscribe:To:Message-Id;
+ b=nrxT2CBi5bvSClWRo2p6oUBu7g9Vf4avwh75xGe5Ha8v3C6yC4XzAn5HVj2eLbg3Q
+ SX73six1vyaUfwZnISQY5A8LZN+KQP1ZOcPYcMVrt59QWpI6t3YusC1A3RghfS6/nC
+ UOphydx1G6qnU3bLfSa6ubMN2sWj3Up+auyiTmv8=
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Type: multipart/alternative; boundary="_----------=_129172500515294581"
+X-Mailer: MIME::Lite 3.027 (F2.77; T1.28; A2.04; B3.08; Q3.08)
+Date: Tue, 7 Dec 2010 12:30:05 +0000
+From: Fred bloggs <fred.bloggs@email.example2.com>
+Subject: foo
+X-Campaignid: example220101008.1
+List-Unsubscribe: <http://www.example2offers.co.uk/unsubscribe.epl?uuid=B847ED2C-01FD-11E0-9F31-E49DFBD33537>
+To: recipient <recipient@example.net>
+Message-Id: <20101207123005.31F623D60006@server4.example2.co.uk>
+
+This is a multi-part message in MIME format.
+
+--_----------=_129172500515294581
+Content-Disposition: inline
+Content-Transfer-Encoding: 8bit
+Content-Type: text/plain
+
+ Text
+
+--_----------=_129172500515294581
+Content-Disposition: inline
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html
+
+HTML
+
+--_----------=_129172500515294581--
+
+
+--31F623D60006.1291725005/server4.example2.co.uk--
diff --git a/t/various-unknown.t b/t/various-unknown.t
index 32ec776..f69f587 100644
--- a/t/various-unknown.t
+++ b/t/various-unknown.t
@@ -1,7 +1,7 @@
#!perl -wT
use strict;
-use Test::More tests => 150;
+use Test::More tests => 156;
use Mail::DeliveryStatus::BounceParser;
@@ -147,6 +147,10 @@ This is a permanent error; I've given up. Sorry it didn't work out.",
"reason" => '550 User [recipient@example.net] does not exist',
"smtp_code" => "550",
},
+ "doesnotexist2.msg" => {
+ "reason" => "550 Recipient does not exist",
+ "smtp_code" => "550",
+ },
);
foreach my $file (keys %files_and_responses) {
--
1.6.1