<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[14607] CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/14607">14607</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2015-03-20 15:43:16 -0700 (Fri, 20 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Peek at incoming IMIPs, and if we don't recognize the token, leave the message unseen so another pod can pick it up.  If an unrecognized-token email is older than 72 hours, delete it instead.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingimipinboundpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/inbound.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingimiptesttest_inboundpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_inbound.py</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingimiptestdatagood_reply_future">CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/data/good_reply_future</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingimiptestdatagood_reply_past">CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/data/good_reply_past</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingimipinboundpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/inbound.py (14606 => 14607)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/inbound.py        2015-03-20 21:01:07 UTC (rev 14606)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/inbound.py        2015-03-20 22:43:16 UTC (rev 14607)
</span><span class="lines">@@ -38,6 +38,8 @@
</span><span class="cx"> from txdav.common.datastore.sql_tables import schema
</span><span class="cx"> 
</span><span class="cx"> import datetime
</span><ins>+import dateutil.parser
+import dateutil.tz
</ins><span class="cx"> import email.utils
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -191,12 +193,13 @@
</span><span class="cx"> 
</span><span class="cx">     NO_TOKEN = 0
</span><span class="cx">     UNKNOWN_TOKEN = 1
</span><del>-    MALFORMED_TO_ADDRESS = 2
-    NO_ORGANIZER_ADDRESS = 3
-    REPLY_FORWARDED_TO_ORGANIZER = 4
-    INJECTION_SUBMITTED = 5
-    INCOMPLETE_DSN = 6
-    UNKNOWN_FAILURE = 7
</del><ins>+    UNKNOWN_TOKEN_OLD = 2
+    MALFORMED_TO_ADDRESS = 3
+    NO_ORGANIZER_ADDRESS = 4
+    REPLY_FORWARDED_TO_ORGANIZER = 5
+    INJECTION_SUBMITTED = 6
+    INCOMPLETE_DSN = 7
+    UNKNOWN_FAILURE = 8
</ins><span class="cx"> 
</span><span class="cx">     def __init__(self, store, directory):
</span><span class="cx">         self.store = store
</span><span class="lines">@@ -326,10 +329,26 @@
</span><span class="cx">             record = records[0]
</span><span class="cx">         except:
</span><span class="cx">             # This isn't a token we recognize
</span><del>-            log.error(
</del><ins>+            log.info(
</ins><span class="cx">                 &quot;Mail gateway found a token (%s) but didn't &quot;
</span><span class="cx">                 &quot;recognize it in message %s&quot;
</span><span class="cx">                 % (token, msg['Message-ID']))
</span><ins>+            # Any email with an unknown token which was sent over 72 hours ago
+            # is deleted.  If we can't parse the date we leave it in the inbox.
+            dateString = msg.get(&quot;Date&quot;)
+            if dateString is not None:
+                try:
+                    dateSent = dateutil.parser.parse(dateString)
+                except Exception, e:
+                    log.info(
+                        &quot;Could not parse date in IMIP email '{}' ({})&quot;.format(
+                            dateString, e
+                        )
+                    )
+                    returnValue(self.UNKNOWN_TOKEN)
+                now = datetime.datetime.now(dateutil.tz.tzutc())
+                if dateSent &lt; now - datetime.timedelta(hours=72):
+                    returnValue(self.UNKNOWN_TOKEN_OLD)
</ins><span class="cx">             returnValue(self.UNKNOWN_TOKEN)
</span><span class="cx"> 
</span><span class="cx">         for part in msg.walk():
</span><span class="lines">@@ -437,6 +456,7 @@
</span><span class="cx"> 
</span><span class="cx">         NO_TOKEN - there was no token in the To address
</span><span class="cx">         UNKNOWN_TOKEN - there was an unknown token in the To address
</span><ins>+        UNKNOWN_TOKEN_OLD - there was an unknown token and it's an old email
</ins><span class="cx">         MALFORMED_TO_ADDRESS - we could not parse the To address at all
</span><span class="cx">         NO_ORGANIZER_ADDRESS - no ics attachment and no email to forward to
</span><span class="cx">         REPLY_FORWARDED_TO_ORGANIZER - no ics attachment, but reply forwarded
</span><span class="lines">@@ -662,9 +682,8 @@
</span><span class="cx">                 self.cbGotMessage, messageListToFetch).addErrback(
</span><span class="cx">                     self.ebLogError)
</span><span class="cx">         else:
</span><del>-            self.log.debug(&quot;Seeing if anything new has arrived&quot;)
-            # Go back and see if any more messages have come in
-            self.expunge().addCallback(self.cbInboxSelected)
</del><ins>+            # We're done for this polling interval
+            self.expunge()
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -684,13 +703,30 @@
</span><span class="cx">             # Delete all mail we see
</span><span class="cx">             yield self.cbFlagDeleted(messageList)
</span><span class="cx">         else:
</span><del>-            # Delete only mail we've processed; the rest are left flagged Seen
</del><ins>+            # Delete only mail we've processed; the rest are left flagged \Seen
</ins><span class="cx">             if actionTaken == MailReceiver.INJECTION_SUBMITTED:
</span><span class="cx">                 yield self.cbFlagDeleted(messageList)
</span><ins>+            elif actionTaken == MailReceiver.UNKNOWN_TOKEN:
+                # It's not a token we recognize (probably meant for another pod)
+                # so remove the \Seen flag
+                yield self.cbFlagUnseen(messageList)
+            elif actionTaken == MailReceiver.UNKNOWN_TOKEN_OLD:
+                # It's not a token we recognize, but it's old, so delete it
+                yield self.cbFlagDeleted(messageList)
</ins><span class="cx">             else:
</span><span class="cx">                 self.fetchNextMessage()
</span><span class="cx"> 
</span><ins>+    def cbFlagUnseen(self, messageList):
+        self.removeFlags(
+            messageList, (&quot;\\Seen&quot;,), uid=True
+        ).addCallback(self.cbMessageUnseen, messageList)
</ins><span class="cx"> 
</span><ins>+
+    def cbMessageUnseen(self, results, messageList):
+        self.log.debug(&quot;Removed \\Seen flag from message&quot;)
+        self.fetchNextMessage()
+
+
</ins><span class="cx">     def cbFlagDeleted(self, messageList):
</span><span class="cx">         self.addFlags(
</span><span class="cx">             messageList, (&quot;\\Deleted&quot;,), uid=True
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingimiptestdatagood_reply_future"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/data/good_reply_future (0 => 14607)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/data/good_reply_future                                (rev 0)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/data/good_reply_future        2015-03-20 22:43:16 UTC (rev 14607)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+Return-path: &lt;xyzzy@example.com&gt;
+Received: from hemlock.example.com ([17.128.115.180])
+ by mail4.example.com (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar
+ 14 2008; 32bit)) with ESMTP id &lt;0K5I00I8I8G50QC0@mail4.example.com&gt; for
+ ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com; Tue,
+ 12 Aug 2008 13:19:17 -0700 (PDT)
+Original-recipient:
+ rfc822;ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com
+Received: from relay14.example.com ([17.128.113.52])
+ by hemlock.example.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28
+ 2007)) with ESMTP id &lt;0K5I004UB8G5UR90@hemlock.example.com&gt; for
+ ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com
+ (ORCPT ical-living-on+2Bd7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com); Tue,
+ 12 Aug 2008 13:19:17 -0700 (PDT)
+Received: from relay14.example.com (unknown [127.0.0.1])
+        by relay14.example.com (Symantec Mail Security) with ESMTP id 6A5EF28087        for
+ &lt;ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com&gt;; Tue,
+ 12 Aug 2008 13:19:17 -0700 (PDT)
+Received: from [17.83.208.154] (unknown [17.83.208.154])
+        (using TLSv1 with cipher AES128-SHA (128/128 bits))
+        (No client certificate requested)        by relay14.example.com (example SCV relay)
+ with ESMTP id CAEE22808B        for
+ &lt;ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com&gt;; Tue,
+ 12 Aug 2008 13:19:16 -0700 (PDT)
+Date: Tue, 12 Aug 2100 13:19:14 -0700
+From: plugh xyzzy &lt;xyzzy@example.com&gt;
+Subject: Event accepted: New Event
+To: User 01 &lt;ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com&gt;
+Message-id: &lt;1983F777-BE86-4B98-881E-06D938E60920@example.com&gt;
+MIME-version: 1.0 (example Message framework v928.1)
+X-Mailer: example Mail (2.928.1)
+Content-type: multipart/alternative; boundary=example-Mail-1--253014167
+X-Mail-Calendar-Part: Yes
+X-Brightmail-Tracker: AAAAAA==
+
+
+--example-Mail-1--253014167
+Content-Type: text/plain;
+        charset=US-ASCII;
+        format=flowed;
+        delsp=yes
+Content-Transfer-Encoding: 7bit
+
+plugh xyzzy has accepted your iCal event invitation to the event: New
+Event, scheduled for August 12, 2008 at 10:00 AM (US/Pacific).
+--example-Mail-1--253014167
+Content-Type: multipart/mixed;
+        boundary=example-Mail-2--253014167
+
+
+--example-Mail-2--253014167
+Content-Type: text/html;
+        charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+
+&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;plugh xyzzy has accepted your iCal event invitation to the event: New Event, scheduled for August 12, 2008 at 10:00 AM (US/Pacific).&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
+--example-Mail-2--253014167
+Content-Disposition: attachment;
+        filename=iCal-20080812-131911.ics
+Content-Type: text/calendar;
+        x-unix-mode=0644;
+        name=&quot;iCal-20080812-131911.ics&quot;
+Content-Transfer-Encoding: quoted-printable
+
+BEGIN:VCALENDAR=0D=0APRODID:-//example=20Inc.//iCal=203.0//EN=0D=0A=
+CALSCALE:GREGORIAN=0D=0AVERSION:2.0=0D=0AMETHOD:REPLY=0D=0A=
+BEGIN:VTIMEZONE=0D=0ATZID:US/Pacific=0D=0ABEGIN:DAYLIGHT=0D=0A=
+TZOFFSETFROM:-0800=0D=0ATZOFFSETTO:-0700=0D=0ADTSTART:20070311T020000=0D=0A=
+RRULE:FREQ=3DYEARLY;BYMONTH=3D3;BYDAY=3D2SU=0D=0ATZNAME:PDT=0D=0A=
+END:DAYLIGHT=0D=0ABEGIN:STANDARD=0D=0ATZOFFSETFROM:-0700=0D=0A=
+TZOFFSETTO:-0800=0D=0ADTSTART:20071104T020000=0D=0A=
+RRULE:FREQ=3DYEARLY;BYMONTH=3D11;BYDAY=3D1SU=0D=0ATZNAME:PST=0D=0A=
+END:STANDARD=0D=0AEND:VTIMEZONE=0D=0ABEGIN:VEVENT=0D=0ASEQUENCE:7=0D=0A=
+DTSTART;TZID=3DUS/Pacific:20080812T100000=0D=0A=
+UID:1E71F9C8-AEDA-48EB-98D0-76E898F6BB5C=0D=0AORGANIZER;CN=3D&quot;User=20=
+01&quot;:mailto:ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08=0D=0A=20=
+002fb285f@example.com=0D=0ADTSTAMP:20080812T201911Z=0D=0ASUMMARY:New=20=
+Event=0D=0A=
+ATTENDEE;CN=3D&quot;xyzzy@example.com&quot;;CUTYPE=3DINDIVIDUAL;PARTSTAT=3DACCEPTED;RO=
+LE=3DR=0D=0A=20EQ-PARTICIPANT:mailto:xyzzy@example.com=0D=0A=
+CREATED:20080812T201906Z=0D=0ADTEND;TZID=3DUS/Pacific:20080812T110000=0D=0A=
+END:VEVENT=0D=0AEND:VCALENDAR=0D=0A=
+
+--example-Mail-2--253014167
+Content-Type: text/html;
+        charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+
+&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
+--example-Mail-2--253014167--
+
+--example-Mail-1--253014167--
</ins></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingimiptestdatagood_reply_past"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/data/good_reply_past (0 => 14607)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/data/good_reply_past                                (rev 0)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/data/good_reply_past        2015-03-20 22:43:16 UTC (rev 14607)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+Return-path: &lt;xyzzy@example.com&gt;
+Received: from hemlock.example.com ([17.128.115.180])
+ by mail4.example.com (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar
+ 14 2008; 32bit)) with ESMTP id &lt;0K5I00I8I8G50QC0@mail4.example.com&gt; for
+ ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com; Tue,
+ 12 Aug 2008 13:19:17 -0700 (PDT)
+Original-recipient:
+ rfc822;ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com
+Received: from relay14.example.com ([17.128.113.52])
+ by hemlock.example.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28
+ 2007)) with ESMTP id &lt;0K5I004UB8G5UR90@hemlock.example.com&gt; for
+ ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com
+ (ORCPT ical-living-on+2Bd7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com); Tue,
+ 12 Aug 2008 13:19:17 -0700 (PDT)
+Received: from relay14.example.com (unknown [127.0.0.1])
+        by relay14.example.com (Symantec Mail Security) with ESMTP id 6A5EF28087        for
+ &lt;ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com&gt;; Tue,
+ 12 Aug 2008 13:19:17 -0700 (PDT)
+Received: from [17.83.208.154] (unknown [17.83.208.154])
+        (using TLSv1 with cipher AES128-SHA (128/128 bits))
+        (No client certificate requested)        by relay14.example.com (example SCV relay)
+ with ESMTP id CAEE22808B        for
+ &lt;ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com&gt;; Tue,
+ 12 Aug 2008 13:19:16 -0700 (PDT)
+Date: Tue, 12 Aug 2008 13:19:14 -0700
+From: plugh xyzzy &lt;xyzzy@example.com&gt;
+Subject: Event accepted: New Event
+To: User 01 &lt;ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08002fb285f@example.com&gt;
+Message-id: &lt;1983F777-BE86-4B98-881E-06D938E60920@example.com&gt;
+MIME-version: 1.0 (example Message framework v928.1)
+X-Mailer: example Mail (2.928.1)
+Content-type: multipart/alternative; boundary=example-Mail-1--253014167
+X-Mail-Calendar-Part: Yes
+X-Brightmail-Tracker: AAAAAA==
+
+
+--example-Mail-1--253014167
+Content-Type: text/plain;
+        charset=US-ASCII;
+        format=flowed;
+        delsp=yes
+Content-Transfer-Encoding: 7bit
+
+plugh xyzzy has accepted your iCal event invitation to the event: New  
+Event, scheduled for August 12, 2008 at 10:00 AM (US/Pacific).
+--example-Mail-1--253014167
+Content-Type: multipart/mixed;
+        boundary=example-Mail-2--253014167
+
+
+--example-Mail-2--253014167
+Content-Type: text/html;
+        charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+
+&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;plugh xyzzy has accepted your iCal event invitation to the event: New Event, scheduled for August 12, 2008 at 10:00 AM (US/Pacific).&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
+--example-Mail-2--253014167
+Content-Disposition: attachment;
+        filename=iCal-20080812-131911.ics
+Content-Type: text/calendar;
+        x-unix-mode=0644;
+        name=&quot;iCal-20080812-131911.ics&quot;
+Content-Transfer-Encoding: quoted-printable
+
+BEGIN:VCALENDAR=0D=0APRODID:-//example=20Inc.//iCal=203.0//EN=0D=0A=
+CALSCALE:GREGORIAN=0D=0AVERSION:2.0=0D=0AMETHOD:REPLY=0D=0A=
+BEGIN:VTIMEZONE=0D=0ATZID:US/Pacific=0D=0ABEGIN:DAYLIGHT=0D=0A=
+TZOFFSETFROM:-0800=0D=0ATZOFFSETTO:-0700=0D=0ADTSTART:20070311T020000=0D=0A=
+RRULE:FREQ=3DYEARLY;BYMONTH=3D3;BYDAY=3D2SU=0D=0ATZNAME:PDT=0D=0A=
+END:DAYLIGHT=0D=0ABEGIN:STANDARD=0D=0ATZOFFSETFROM:-0700=0D=0A=
+TZOFFSETTO:-0800=0D=0ADTSTART:20071104T020000=0D=0A=
+RRULE:FREQ=3DYEARLY;BYMONTH=3D11;BYDAY=3D1SU=0D=0ATZNAME:PST=0D=0A=
+END:STANDARD=0D=0AEND:VTIMEZONE=0D=0ABEGIN:VEVENT=0D=0ASEQUENCE:7=0D=0A=
+DTSTART;TZID=3DUS/Pacific:20080812T100000=0D=0A=
+UID:1E71F9C8-AEDA-48EB-98D0-76E898F6BB5C=0D=0AORGANIZER;CN=3D&quot;User=20=
+01&quot;:mailto:ical-living-on+d7cdf68d-8b73-4df1-ad3b-f08=0D=0A=20=
+002fb285f@example.com=0D=0ADTSTAMP:20080812T201911Z=0D=0ASUMMARY:New=20=
+Event=0D=0A=
+ATTENDEE;CN=3D&quot;xyzzy@example.com&quot;;CUTYPE=3DINDIVIDUAL;PARTSTAT=3DACCEPTED;RO=
+LE=3DR=0D=0A=20EQ-PARTICIPANT:mailto:xyzzy@example.com=0D=0A=
+CREATED:20080812T201906Z=0D=0ADTEND;TZID=3DUS/Pacific:20080812T110000=0D=0A=
+END:VEVENT=0D=0AEND:VCALENDAR=0D=0A=
+
+--example-Mail-2--253014167
+Content-Type: text/html;
+        charset=US-ASCII
+Content-Transfer-Encoding: 7bit
+
+&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
+--example-Mail-2--253014167--
+
+--example-Mail-1--253014167--
</ins></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingimiptesttest_inboundpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_inbound.py (14606 => 14607)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_inbound.py        2015-03-20 21:01:07 UTC (rev 14606)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/imip/test/test_inbound.py        2015-03-20 22:43:16 UTC (rev 14607)
</span><span class="lines">@@ -190,9 +190,13 @@
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_processReply(self):
</span><del>-        msg = email.message_from_string(self.dataFile('good_reply'))
</del><ins>+        # Make sure an unknown token in an older email is deleted
+        msg = email.message_from_string(self.dataFile('good_reply_past'))
+        result = (yield self.receiver.processReply(msg))
+        self.assertEquals(result, MailReceiver.UNKNOWN_TOKEN_OLD)
</ins><span class="cx"> 
</span><span class="cx">         # Make sure an unknown token is not processed
</span><ins>+        msg = email.message_from_string(self.dataFile('good_reply_future'))
</ins><span class="cx">         result = (yield self.receiver.processReply(msg))
</span><span class="cx">         self.assertEquals(result, MailReceiver.UNKNOWN_TOKEN)
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>