aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Houston <robin@lenny.robin>2011-09-08 06:18:35 +0100
committerRobin Houston <robin@lenny.robin>2011-09-08 06:18:35 +0100
commite6c088e6b72e5bfee26fda8d933e8d71ea672b30 (patch)
tree272a44d425d1e460bf4cb39f13d6e7344bf57c77
parent71048a2bd639943801d626fa89e2dfcb2ebb7ee2 (diff)
More out-of-office message detection
-rwxr-xr-xscript/handle-mail-replies3
-rw-r--r--spec/fixtures/files/track-response-lotus-oof-1.email58
-rw-r--r--spec/script/handle-mail-replies_spec.rb5
3 files changed, 66 insertions, 0 deletions
diff --git a/script/handle-mail-replies b/script/handle-mail-replies
index fa45d135a..b4846b440 100755
--- a/script/handle-mail-replies
+++ b/script/handle-mail-replies
@@ -106,6 +106,9 @@ def is_oof?(message)
if subject.start_with? "Out of Office AutoReply:"
return true
end
+ if subject.end_with? "is out of the office"
+ return true
+ end
return false
end
diff --git a/spec/fixtures/files/track-response-lotus-oof-1.email b/spec/fixtures/files/track-response-lotus-oof-1.email
new file mode 100644
index 000000000..dbe63714d
--- /dev/null
+++ b/spec/fixtures/files/track-response-lotus-oof-1.email
@@ -0,0 +1,58 @@
+Delivered-To: mysociety.robin@gmail.com
+Received: by 10.216.187.197 with SMTP id y47cs137414wem;
+ Wed, 7 Sep 2011 14:02:45 -0700 (PDT)
+Received: by 10.227.179.14 with SMTP id bo14mr1666492wbb.90.1315429363348;
+ Wed, 07 Sep 2011 14:02:43 -0700 (PDT)
+Return-Path: <Arnos.Grove@example.net>
+Received: from wildfire.ukcod.org.uk (wildfire.ukcod.org.uk [89.238.145.74])
+ by mx.google.com with ESMTPS id 2si1547851wbx.79.2011.09.07.14.02.41
+ (version=TLSv1/SSLv3 cipher=OTHER);
+ Wed, 07 Sep 2011 14:02:42 -0700 (PDT)
+Received-SPF: neutral (google.com: 89.238.145.74 is neither permitted nor denied by best guess record for domain of Arnos.Grove@example.net) client-ip=89.238.145.74;
+Authentication-Results: mx.google.com; spf=neutral (google.com: 89.238.145.74 is neither permitted nor denied by best guess record for domain of Arnos.Grove@example.net) smtp.mail=Arnos.Grove@example.net
+Received: from foi by wildfire.ukcod.org.uk with local (Exim 4.69)
+ (envelope-from <Arnos.Grove@example.net>)
+ id 1R1PGV-0008Gu-GX
+ for team@whatdotheyknow.com; Wed, 07 Sep 2011 22:02:35 +0100
+Received: from eu1sys200aog108.obsmtp.com ([207.126.144.125]:54514)
+ by wildfire.ukcod.org.uk with smtp (Exim 4.69)
+ (envelope-from <Arnos.Grove@example.net>)
+ id 1R1PGS-0008Go-Ih
+ for track@whatdotheyknow.com; Wed, 07 Sep 2011 22:02:32 +0100
+Received: from DomG5P.tm-gnet.com ([80.195.120.125]) by eu1sys200aob108.postini.com ([207.126.147.11]) with SMTP
+ ID DSNKTmfb6CEGJQfujkX1ZzzGzMsn6uoI+AGs@postini.com; Wed, 07 Sep 2011 21:02:32 UTC
+Received: from dc3-email-02.tm-gnet.com ([10.145.42.2])
+ by DomG5P.tm-gnet.com (Lotus Domino Release 7.0.3)
+ with ESMTP id 2011090722024075-323511 ;
+ Wed, 7 Sep 2011 22:02:40 +0100
+Subject: Emma McKinney/MAIL/BIR/MG_REG is out of the office
+Auto-Submitted: auto-generated
+From: Arnos.Grove@example.net
+To: track@whatdotheyknow.com
+Message-ID: <OF82EB79DF.C2563724-ON80257904.00739633-80257904.00739633@TrinityMirror.com>
+Date: Wed, 7 Sep 2011 22:02:30 +0100
+MIME-Version: 1.0
+X-MIMETrack: Serialize by Router on DC3-Email-02/GMH(Release 8.5.1FP4|July 25, 2010) at
+ 07/09/2011 22:02:31,
+ Itemize by SMTP Server on DomG5P/GMH(Release 7.0.3|September 26, 2007) at
+ 09/07/2011 22:02:40,
+ Serialize by Router on DomG5P/GMH(Release 7.0.3|September 26, 2007) at 09/07/2011
+ 22:02:41,
+ Serialize complete at 09/07/2011 22:02:41
+Content-type: text/plain; charset=US-ASCII
+List-Id: Admin Team for What Do They Know <team@whatdotheyknow.com>
+
+
+I will be out of the office starting dd/mm/yyyy and will not return until
+dd/mm/yyyy.
+
+If you need to contact anyone urgently while I'm out of the office call
+aaaa bbb cccc or aaaa bbb dddd.
+
+********************
+IMPORTANT NOTICE This email (including any attachments) is meant only for the intended recipient. It may also contain confidential and privileged information. If you are not the intended recipient, any reliance on, use, disclosure, distribution or copying of this email or attachments is strictly prohibited. Please notify the sender immediately by email if you have received this message by mistake and delete the email and all attachments.
+
+Any views or opinions in this email are solely those of the author and do not necessarily represent those of Brickbat Industries PLC or its associated group companies (hereinafter referred to as "BI Group"). BI Group accept no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Although every reasonable effort is made to keep its network free from viruses, BI Group accept no liability for any virus transmitted by this email or any attachments and the recipient should use up-to-date virus checking software. Email to or from this address may be subject to interception or monitoring for operational reasons or for lawful business practices.
+
+Brickbat PLC is the parent company of the Brickbat group of companies and is registered in England No 99999, with its address at Nine Made-up Lane, Arnos Grove.
+********************
diff --git a/spec/script/handle-mail-replies_spec.rb b/spec/script/handle-mail-replies_spec.rb
index 2ef8d6afa..b3e6e5dbb 100644
--- a/spec/script/handle-mail-replies_spec.rb
+++ b/spec/script/handle-mail-replies_spec.rb
@@ -39,5 +39,10 @@ describe "When filtering" do
r = mail_reply_test("track-response-exchange-oof-1.email")
r.status.should == 2
end
+
+ it "should detect a Lotus Domino-style out-of-office" do
+ r = mail_reply_test("track-response-lotus-oof-1.email")
+ r.status.should == 2
+ end
end