2

I'm trying to create a client that can accept a meeting invitation using ActiveSync. I have the meetingresponse over ActiveSync working, but when I send the confirmation email to the organizer and attach the iCalendar formatted reply, it doesn't get parsed out by the server as it should. Instead, it's converted to an attachment and the users attendee status never gets updated.

Here's the MIME email I'm sending:

From: t@xxx.ca
To: Tester Testing <test@xxx.ca>
Message-ID: <i8swl8yv.-4t2@-1387408011.xxx.ca>
Subject: Accepted: Test 11:36 Wed
MIME-Version: 1.0
Content-Type: multipart/alternative; 
 boundary="----=_Part_0_1114661696.1429717004439"

------=_Part_0_1114661696.1429717004439
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

these are forced comments
------=_Part_0_1114661696.1429717004439
Content-Type: text/calendar; method=REPLY; charset=utf-8; name=meeting.ics
Content-Transfer-Encoding: quoted-printable

BEGIN:VCALENDAR
METHOD:REPLY
PRODID:XXXEmail
VERSION:2.0
BEGIN:VEVENT
ATTENDEE;PARTSTAT=ACCEPTED:MAILTO:t@xxx.ca
ORGANIZER:MAILTO:test@xxx.ca
DTSTART:20150422T120000
DTEND:20150422T123000
DTSTAMP:20150422T113625
LOCATION;LANGUAGE=en-US:here
UID:3D6D7B89-DE7E-45A1-B916-19DEDB2B1ADC
CLASS:PUBLIC
STATUS:CONFIRMED
TRANSP:OPAQUE
PRIORITY:5
SEQUENCE:0
END:VEVENT
END:VCALENDAR

------=_Part_0_1114661696.1429717004439--

Does anyone see an issue with the iCalendar Reply? Or how the mime is formatted? Or any ideas why this won't work?

EDIT: As requested, here's an example MIME email that was correctly parsed on the server:

Content-Type: multipart/alternative; boundary="===============0124021817=="
X-Client-ID: 57
X-Mailer: BlackBerry Email (10.3.1.2576)
Message-ID: <20150422140519.5439570.43618.57@xxx.ca>
Date: Wed, 22 Apr 2015 10:05:19 -0400
Subject: Accepted: test at 10:04 Wed
From: <t@xxx.ca>
To: <test@xxx.ca>
MIME-Version: 1.0

--===============0124021817==
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Commment

--===============0124021817==
Content-Type: text/calendar; charset="utf-8"; name="meeting.ics"; method=REPLY
Content-Transfer-Encoding: quoted-printable

BEGIN:VCALENDAR
PRODID:-//Research In Motion//RIM App//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REPLY
BEGIN:VTIMEZONE
TZID:America/New_York
BEGIN:STANDARD
DTSTART:20071104T020000
RRULE:FREQ=3DYEARLY;BYDAY=3D1SU;BYMONTH=3D11
TZNAME:EST
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20070311T020000
RRULE:FREQ=3DYEARLY;BYDAY=3D2SU;BYMONTH=3D3
TZNAME:EDT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ATTENDEE;RSVP=3DTRUE;ROLE=3DREQ-PARTICIPANT;CN=3DTest Test;PARTSTAT=3DACCE=
PTED:mailto:
 t@xxx.ca
COMMENT:Commment
CREATED:20150422T140505Z
DTEND;TZID=3DAmerica/New_York:20150422T110000
DTSTAMP:20150422T140518Z
DTSTART;TZID=3DAmerica/New_York:20150422T103000
LOCATION:here
ORGANIZER;CN=3DTesting Tester:mailto:test@xxx.ca
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:test at 10:04 Wed
TRANSP:OPAQUE
UID:A885C120-ABAD-4418-AB24-8B93E57194F0
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:test at 10:04 Wed in 15 minutes.
TRIGGER;RELATED=3DSTART:-PT15M
X-WR-ALARMUID:9b758290-e8f8-11e4-afff-b57e838ad0c3
END:VALARM
END:VEVENT
END:VCALENDAR

--===============0124021817==--

I've tried including the timezone information and it still didn't work. I have another email program that also accepts meeting invites properly, and my iCalendar attachment is basically identical to theirs (they base64 encode the iCalendar attachment which I've also tried with no luck).

When using a different MIME writer (this one came from Android open source project), the vCalendar content I'm sending it interpreted and parsed correctly. I can't see any differences in the MIME format though (besides it being Base64 encoded which I tried and didn't work)...?

Date: Mon, 27 Apr 2015 14:22:43 -0400
Subject: Accepted: test event Monday 2:22
Message-ID: <i907pyoo.17vp@-1387408011.xxx.ca>
From: t@xxx.ca
To: "Tester Testing" <test@xxx.ca>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=" _com.android.email_7881218929099440"

----_com.android.email_7881218929099440
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64

----_com.android.email_7881218929099440
Content-Type: text/calendar;
 name="meeting.ics"
Content-Transfer-Encoding: base64

QkVHSU46VkNBTEVOREFSDQpNRVRIT0Q6UkVQTFkNClBST0RJRDpYWFhFbWFpbA0KVkVSU0lPTjoyLjANCkJFR0lOOlZFVkVOVA0KVUlEOkFGQzMyNURELTk1MjYtNENFRS05MTlBLUI4RkIxQzU1RTBCQw0KQVRURU5ERUU7UEFSVFNUQVQ9QUNDRVBURUQ6TUFJTFRPOnRAeHh4LmNhDQpPUkdBTklaRVI6TUFJTFRPOnRlc3RAeHh4LmNhDQpEVFNUQVJUOjIwMTUwNDI3VDE0MzAwMA0KRFRFTkQ6MjAxNTA0MjdUMTUwMDAwDQpEVFNUQU1QOjIwMTUwNDI3VDE0MjIzMQ0KTE9DQVRJT047TEFOR1VBR0U9ZW4tVVM6aGVyZQ0KQ0xBU1M6UFVCTElDDQpTVEFUVVM6Q09ORklSTUVEDQpUUkFOU1A6T1BBUVVFDQpQUklPUklUWTo1DQpTRVFVRU5DRTowDQpFTkQ6VkVWRU5UDQpFTkQ6VkNBTEVOREFS

----_com.android.email_7881218929099440--
forevercrashed
  • 135
  • 1
  • 1
  • 8

1 Answers1

0

Try using multipart/mixed instead of multipart/alternative.

Bill Shannon
  • 29,579
  • 6
  • 38
  • 40
  • Thanks for the response, unfortunately I get the same thing. The .ics file shows up as an attachment, and is never parsed by the server. – forevercrashed Apr 22 '15 at 19:04
  • Do you have an example confirmation email, created by another program, that does get parsed correctly by the server? – Bill Shannon Apr 22 '15 at 23:30
  • See original question above, I've edited it to include an example MIME that works as expected. – forevercrashed Apr 23 '15 at 14:56
  • It is interesting that it uses multipart/alternative, but apparently that didn't work for you either. Other than that, there doesn't seem to be any significant difference in the MIME structure of the message, which suggests that the problem is in the vcalendar content. Can you try with a copy of the working vcalendar part, with some minor tweaks so that it looks like a different appointment? – Bill Shannon Apr 23 '15 at 18:24
  • Ok, so I tried reusing the vCalendar content (except the UID) to accept an identical meeting and I still ended up in the same situation. Here's a couple other weird things: When I view the source message of my sent item in Outlook I see the server has changed the message (it's changed my headers, base64 encoded the vCalendar object, and inserted a piece about it being a MIME message that my mail reader cannot understand). However, the other email (the one that worked) shows up as sent (ie: the headers haven't changed, nor has the vCalendar object, and no message about it being a MIME)...odd. – forevercrashed Apr 24 '15 at 19:32
  • Exchange doesn't actually store the message in MIME format so it converts everything it gets to its own format and then converts it back to MIME when you read it, which means sometimes you don't get back the same thing you sent. – Bill Shannon Apr 24 '15 at 23:34
  • Ok, so that must mean that the MIME I'm sending is somehow different than the MIME being sent by the other mail program since Exchange is obviously treating each differently (one is converted and very different, one does not look to be converted at all). I looked through the Android open source and found the class Google is using to create their MIME formatted message called Rfc822Output.java. When I use their class and send my vCalendar content, it works...I'll post the MIME output from theirs above. Any ideas what would be so different? – forevercrashed Apr 27 '15 at 18:38
  • Interesting. The messages seem to be logically equivalent. It looks like it's expecting multipart/alternative, so if you're still using that that should be ok. The encoding of the text body parts shouldn't matter, and you have examples of both quoted-printable and base64 that work, so that shouldn't be an issue. I can't see anything else that's obviously different about the structure of the message. Is there any sort of error message or log file output on the server for the rejected messages? – Bill Shannon Apr 27 '15 at 19:12
  • Nothing on the server side I've seen. The messages aren't actually rejected by the server, it's just not parsing out the vCalendar object and is instead converting it to an attachment it claims it can't understand. I've put in a question with Microsoft around this too, perhaps they'll have more information or a way I can capture any messages the server spits out when attempting to parse the MIME. Thanks for your help. – forevercrashed Apr 27 '15 at 19:44