CC: | michael.stevens [...] dianomi.com,michael.smith [...] dianomi.com |
Subject: | Another Boxbe CR case |
Recognise more messages from boxbe as not bounces.
Patch attached or see http://gitorious.org/mail-deliverystatus-
bounceparser-fork/mail-deliverystatus-bounceparser-
fork/commit/28d2fcc780fd40fda8e96785a6d3fce3aea00f54
Subject: | 0001-Messages-from-Boxbe-aren-t-bounces.patch |
From 28d2fcc780fd40fda8e96785a6d3fce3aea00f54 Mon Sep 17 00:00:00 2001
From: Michael Stevens <mstevens@etla.org>
Date: Mon, 20 Dec 2010 11:07:14 +0000
Subject: [PATCH] Messages from Boxbe aren't bounces.
---
MANIFEST | 2 +
lib/Mail/DeliveryStatus/BounceParser.pm | 7 ++
t/boxbe2.t | 25 +++++
t/corpus/boxbe-cr2.msg | 179 +++++++++++++++++++++++++++++++
4 files changed, 213 insertions(+), 0 deletions(-)
create mode 100644 t/boxbe2.t
create mode 100644 t/corpus/boxbe-cr2.msg
diff --git a/MANIFEST b/MANIFEST
index 60a5bd1..79afd72 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -18,6 +18,7 @@ t/aol-attachment.t
t/aol-senderblock.t
t/bluebottle.t
t/boxbe.t
+t/boxbe2.t
t/corpus/aol-senderblock.msg
t/corpus/aol.attachment.msg
t/corpus/aol.unknown.msg
@@ -26,6 +27,7 @@ t/corpus/att-via-sendmail.unknown.msg
t/corpus/badrcptto.msg
t/corpus/bluebottle.msg
t/corpus/boxbe-cr.msg
+t/corpus/boxbe-cr2.msg
t/corpus/comcast-via-sendmail.unknown.msg
t/corpus/cox-via-sendmail.unknown.msg
t/corpus/deactivated-mailbox.msg
diff --git a/lib/Mail/DeliveryStatus/BounceParser.pm b/lib/Mail/DeliveryStatus/BounceParser.pm
index 15e3aef..32fa8f9 100644
--- a/lib/Mail/DeliveryStatus/BounceParser.pm
+++ b/lib/Mail/DeliveryStatus/BounceParser.pm
@@ -198,6 +198,13 @@ sub parse {
$self->{is_bounce} = 0;
}
+ {
+ last unless $first_part->stringify_body =~ /This\s+is\s+a\s+one-time\s+automated\s+message\s+to\s+confirm\s+that\s+you're\s+listed\s+on\s+my\s+Boxbe\s+Guest\s+List/;
+ $self->log("Looks like a challenge/response autoresponse; ignoring.");
+ $self->{type} = "Challenge / Response system autoreply";
+ $self->{is_bounce} = 0;
+ }
+
# we'll deem autoreplies to be usually less than a certain size.
# Some vacation autoreplies are (sigh) multipart/mixed, with an additional
diff --git a/t/boxbe2.t b/t/boxbe2.t
new file mode 100644
index 0000000..a978520
--- /dev/null
+++ b/t/boxbe2.t
@@ -0,0 +1,25 @@
+#!perl -wT
+use strict;
+
+use Test::More tests => 2;
+
+use Mail::DeliveryStatus::BounceParser;
+
+# Test parsing boxbe Challlenge/Response
+
+# FH because we're being backcompat to pre-lexical
+sub readfile {
+ my $fn = shift;
+ open FH, "$fn" or die $!;
+ local $/;
+ my $text = <FH>;
+ close FH;
+ return $text;
+}
+
+my $message = readfile('t/corpus/boxbe-cr2.msg');
+
+my $bounce = Mail::DeliveryStatus::BounceParser->new($message);
+
+isa_ok($bounce, 'Mail::DeliveryStatus::BounceParser');
+ok(!$bounce->is_bounce, "C/R messages are not bounces");
diff --git a/t/corpus/boxbe-cr2.msg b/t/corpus/boxbe-cr2.msg
new file mode 100644
index 0000000..0d23d44
--- /dev/null
+++ b/t/corpus/boxbe-cr2.msg
@@ -0,0 +1,179 @@
+Delivered-To: automated-bounces+1f25b518-091c-11e0-acaf-ad13d00e5aac@email.example.com
+Received: by 10.216.139.130 with SMTP id c2cs78447wej;
+ Thu, 16 Dec 2010 05:55:34 -0800 (PST)
+Received: by 10.100.122.3 with SMTP id u3mr5337137anc.30.1292507732789;
+ Thu, 16 Dec 2010 05:55:32 -0800 (PST)
+Return-Path: <noreply@boxbe.com>
+Received: from qcfs003.boxbe.com (qcfs003.boxbe.com [38.110.147.12])
+ by mx.google.com with ESMTP id w15si5654323anw.18.2010.12.16.05.55.31;
+ Thu, 16 Dec 2010 05:55:31 -0800 (PST)
+Received-SPF: pass (google.com: domain of noreply@boxbe.com designates 38.110.147.12 as permitted sender) client-ip=38.110.147.12;
+Authentication-Results: mx.google.com; spf=pass (google.com: domain of noreply@boxbe.com designates 38.110.147.12 as permitted sender) smtp.mail=noreply@boxbe.com; dkim=pass header.i=@boxbe.com
+Received: from qcfs003.boxbe.com (localhost [127.0.0.1])
+ by qcfs003.boxbe.com (Postfix) with ESMTP id C3026365FDB
+ for <automated-bounces+1F25B518-091C-11E0-ACAF-AD13D00E5AAC@email.example.com>; Thu, 16 Dec 2010 05:55:30 -0800 (PST)
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=boxbe.com; h=date:from
+ :reply-to:to:message-id:subject:mime-version:content-type; s=s1;
+ bh=AEdAXdefbNSxu+BMJiYgD6zGZRY=; b=uGa9hkXSjbPI61CKB3oIljWhd3tR
+ lP45fR4AvyJCDvZFDzWyM82TWFqCnMXhzsytzo7Idd6DCL8bhuM1a9vqXv7iDBhj
+ sy7oYlO8dSzGLX4iNI9fxr4G5QBVuFd476LM9XEXn/o1CKm+268qyYfkXrA4TKL3
+ XpFOciHtwkySQRg=
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=boxbe.com; h=date:from
+ :reply-to:to:message-id:subject:mime-version:content-type; q=
+ dns; s=s1; b=3kSMsVLbo54TcyxzHDlWNHgAENU+1KCHu+TRtUyo7Cnl0WgKarM
+ NX5PEQdhAtL20K8JBgZkT6N1NxT9lte9zOfnRxebd8ylJczEK2F4U2gcU64DuqhI
+ 6d9O5vM7ow+wjiuHB+OscJ/fM39Bs1W/Juq6ETZSlTrKKx8HOfxYNjsI=
+Received: from app008.boxbe.com (unknown [10.0.0.33])
+ by qcfs003.boxbe.com (Postfix) with ESMTP id C14F635F114
+ for <automated-bounces+1F25B518-091C-11E0-ACAF-AD13D00E5AAC@email.example.com>; Thu, 16 Dec 2010 05:55:30 -0800 (PST)
+Date: Thu, 16 Dec 2010 05:55:30 -0800 (PST)
+From: noreply@boxbe.com
+Reply-To: recipient@example.net
+To:
+ Fred Bloggs <automated-bounces+1F25B518-091C-11E0-ACAF-AD13D00E5AAC@email.example.com>
+Message-ID: <1266199703.279141.1292507730790.JavaMail.prod@app008.boxbe.com>
+Subject: Re: Dear Mr recipient, Get your Free 2011 Investment Action Plan
+MIME-Version: 1.0
+Content-Type: multipart/report;
+ boundary="----=_Part_279140_1501921163.1292507730787";
+ report-type=delivery-status
+Envelope-From: <>
+
+------=_Part_279140_1501921163.1292507730787
+Content-Type: multipart/alternative;
+ boundary="----=_Part_279139_41104550.1292507730787"
+Content-Disposition: inline
+Content-Description: Notification
+
+The contents of this message require a modern email client
+for correct display. If you are reading this message, it may
+be because your reader is without MIME support.
+
+You can visit http://www.boxbe.com for more information about
+this problem, or consult the provider of your email reader.
+------=_Part_279139_41104550.1292507730787
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline
+
+
+Hello Fred Bloggs,
+
+I received your message about "Dear Mr recipient, Get your Free 2011 Investment Action Plan".
+This is a one-time automated message to confirm that you're listed on
+my Boxbe Guest List.
+
+Email from you will go right to my Inbox.
+
+
+
+ Thank you,
+ recipient
+
+
+About this Notice
+Boxbe prioritizes and screens email using a personal Guest List and your
+extended social network. It's free, it removes clutter, and it helps
+you focus on the people who matter to you.
+
+Visit http://www.boxbe.com/how-it-works?tc=1234
+End Email Overload
+
+
+------=_Part_279139_41104550.1292507730787
+Content-Type: text/html; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline
+
+
+
+<html>
+<body>
+<div style="width:500px;font-size:13px;font-family:'Lucida Grande', Helvetica, Arial, sans-serif;">
+
+ <p style="margin-bottom:7px;">
+ Hello Fred Bloggs,
+ </p>
+
+ <p style="margin-bottom:7px;">
+ Thanks for the message about "Dear Mr recipient, Get your Free 2011 Investment Action Plan". This is a one-time automatic confirmation to let you know you're on my <a href="http://www.boxbe.com/?tc=1234">Boxbe Guest List</a>.
+ </p>
+
+ <p style="margin-bottom:7px;">
+ Email from you will be delivered right to my Inbox.
+ </p>
+
+
+
+ <p style="margin-bottom:7px;">Thank you,<br />
+ recipient
+ </p>
+
+<p style="margin-bottom:7px;margin-top:20px;"><strong>About this Notice</strong><br />
+Boxbe (<a href="http://www.boxbe.com/?tc=1234">www.boxbe.com</a>) prioritizes and screens your email using a Guest List and your extended social network. It's free, it removes clutter, and it helps you focus on the people who matter to you.
+</p>
+
+<p style="margin-bottom:10px;">
+ <a style="margin-bottom:8px;" href="http://www.boxbe.com/how-it-works?tc=1234"><img style="border:none;" src="http://www.boxbe.com/images/boxbe.gif?tc=1234" alt="Boxbe"></a><img src="http://www.boxbe.com/stfopen?tc=1234"/>
+ <br />End Email Overload
+</p>
+
+</div>
+
+</body>
+</html>
+
+------=_Part_279139_41104550.1292507730787--
+
+------=_Part_279140_1501921163.1292507730787
+Content-Type: message/delivery-status
+Content-Transfer-Encoding: 7bit
+Content-Description: Delivery report
+
+Reporting-MTA: dns; boxbe.com
+Remote-MTA: dns; yahoo.com
+Action: failed
+Arrival-Date: Thu, 16 Dec 2010 05:55:20 -0800 (PST)
+
+Final-Recipient: rfc822; recipient@example.net
+Diagnostic-Code: X-Boxbe-Notice; Sender not pre-approved. Follow instructions in above notice
+Status: 4.7.0
+
+
+------=_Part_279140_1501921163.1292507730787
+Content-Type: message/rfc822
+Content-Description: Undelivered Message
+
+Received-SPF: pass (google.com: domain of
+ automated-bounces+1F25B518-091C-11E0-ACAF-AD13D00E5AAC@email.example.com
+ designates 94.236.45.212 as permitted sender) client-ip=94.236.45.212;
+Date: Thu, 16 Dec 2010 13:55:20 +0000
+Delivered-To: recipient@example.net
+Content-Transfer-Encoding: 7bit
+Authentication-Results: mx.google.com; spf=pass (google.com: domain of
+ automated-bounces+1F25B518-091C-11E0-ACAF-AD13D00E5AAC@email.example.com
+ designates 94.236.45.212 as permitted sender)
+ smtp.mail=automated-bounces+1F25B518-091C-11E0-ACAF-AD13D00E5AAC@email.example.com;
+ dkim=pass header.i=@email.example.com
+Return-Path: <automated-bounces+1F25B518-091C-11E0-ACAF-AD13D00E5AAC@email.example.com>
+Message-Id: <20101216135520.BA1CF16581F7@server4.example.co.uk>
+Received: by 10.204.22.15 with SMTP id l15cs96839bkb; Thu, 16 Dec 2010
+ 05:55:23 -0800 (PST)
+Received: by 10.216.157.70 with SMTP id n48mr9615792wek.37.1292507723051; Thu,
+ 16 Dec 2010 05:55:23 -0800 (PST)
+Received: from server4.example.co.uk (server4.example.co.uk [94.236.45.212])
+ by mx.google.com with ESMTP id l76si103222wej.111.2010.12.16.05.55.21; Thu,
+ 16 Dec 2010 05:55:21 -0800 (PST)
+Received: by server4.example.co.uk (Postfix, from userid 505) id BA1CF16581F7;
+ Thu, 16 Dec 2010 13:55:20 +0000 (GMT)
+Subject: foo
+To: recipient <recipient@example.net>
+From: Fred Bloggs <fred.bloggs@email.example.com>
+List-Unsubscribe: <http://www.exampleoffers.co.uk/unsubscribe.epl?uuid=1F25B518-091C-11E0-ACAF-AD13D00E5AAC>
+X-Mailer: MIME::Lite 3.027 (F2.77; T1.28; A2.04; B3.08; Q3.08)
+Content-Type: multipart/related; boundary="_----------=_1292507720113723496"
+X-Campaignid: example20100129.2
+MIME-Version: 1.0
+
+
+------=_Part_279140_1501921163.1292507730787--
--
1.7.3.1