Closed Bug 351997 Opened 18 years ago Closed 18 years ago

Lightning throws exception when viewing event invitation sent from iCal.app

Categories

(MailNews Core :: MIME, defect)

PowerPC
macOS
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mattwillis, Assigned: Bienvenu)

References

Details

(Keywords: fixed1.8.1)

Attachments

(2 files)

You can invite people to events in iCal.app.  When iCal.app sends the invitation, it encodes the included ICS data as quoted-printable.  When Thunderbird hands us the data from the message, the data is still encoded (containing =0D and =0A chars instead of \r and \n) which causes our ics parse to barf.

Part of this is deciding whether or not the data should be decoded by Thunderbird before it hands it off to us.  I would tend to argue yes, but I could be convinced otherwise.



Error from Thunderbird's error console:
Error: [Exception... "Component returned failure code: 0x804a0100 [calIICSService.parseICS]"  nsresult: "0x804a0100 (<unknown>)"  location: "JS frame :: file:///Users/mwillis/Library/Thunderbird/Profiles/f3zmkc5o.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/js/calItemBase.js :: icalFromString :: line 761"  data: no]
Source File: file:///Users/mwillis/Library/Thunderbird/Profiles/f3zmkc5o.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/js/calItemBase.js
Line: 761


Example ICS that is passed to Lightning:

Content-Transfer-Encoding: quoted-printable
Content-Type: text/calendar;
	x-unix-mode=0644;
	name=iCal-20060908-150855.ics
Content-Disposition: attachment;
	filename=iCal-20060908-150855.ics

BEGIN:VCALENDAR=0D=0APRODID:-//Apple=20Computer\,=20Inc//iCal=202.0//EN=0D=
=0AMETHOD:REQUEST=0D=0ACALSCALE:GREGORIAN=0D=0AVERSION:2.0=0D=0A=
BEGIN:VTIMEZONE=0D=0ATZID:America/New_York=0D=0A=
LAST-MODIFIED:20060908T190855Z=0D=0ABEGIN:DAYLIGHT=0D=0A=
DTSTART:20060402T070000=0D=0ATZOFFSETTO:-0400=0D=0ATZOFFSETFROM:+0000=0D=0A=
TZNAME:EDT=0D=0AEND:DAYLIGHT=0D=0ABEGIN:STANDARD=0D=0A=
DTSTART:20061029T020000=0D=0ATZOFFSETTO:-0500=0D=0ATZOFFSETFROM:-0400=0D=0A=
TZNAME:EST=0D=0AEND:STANDARD=0D=0AEND:VTIMEZONE=0D=0ABEGIN:VEVENT=0D=0A=
DURATION:PT1H=0D=0AATTENDEE;CN=3D"Matthew=20=
Willis";PARTSTAT=3DACCEPTED:mailto:mattwillis@mac.com=0D=0A=20=0D=0A=
ATTENDEE:mailto:mattstest@ecornell.com=0D=0ADTSTAMP:20060908T190852Z=0D=0A=
UID:B756B5BC-B459-4705-8602-3B768A42A630=0D=0ASEQUENCE:7=0D=0A=
DTSTART;TZID=3DAmerica/New_York:20060908T160000=0D=0ASUMMARY:Testy=20=
Vent=0D=0AORGANIZER;CN=3D"Matthew=20Willis":mailto:mattwillis@mac.com=0D=0A=
END:VEVENT=0D=0AEND:VCALENDAR=0D=0A=


Interesting lxr links for possible help:

Quoted Printable decoder:
http://lxr.mozilla.org/mozilla/source/mailnews/mime/src/mimeenc.cpp#827

nsSimpleMimeConverterStub:
http://lxr.mozilla.org/mozilla/source/mailnews/mime/src/nsSimpleMimeConverterStub.cpp
Summary: Lightning can't handle an event invitation sent from iCal.app → Lightning throws exception when viewing event invitation sent from iCal.app
The simple mime converter needs to do the decoding, I think. For some interesting details, see 

http://lxr.mozilla.org/seamonkey/source/mailnews/mime/src/mimeleaf.h#44

I'll try to figure out how it would do that...
looking at the code, I'm not sure that this shouldn't be happening automatically already from functionality in the MimeLeaf class...but Mime's hand-rolled object-orientedness doesn't make it easy to know for sure.
Attached patch proposed fixSplinter Review
we need to initialize the base class object in order for the decoders to work.
Attachment #238448 - Flags: first-review?(mscott)
Attachment #238448 - Flags: first-review?(mscott) → first-review+
fixed on trunk and 1.8.1 branch
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Component: Lightning Only → MailNews: MIME
Flags: first-review+
Product: Calendar → Core
Resolution: FIXED → ---
Target Milestone: Lightning 0.3 → ---
Assignee: cmtalbert → bienvenu
Status: REOPENED → NEW
oving to core | mime component, reassigning to myself, and marking fixed.
Status: NEW → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
QA Contact: lightning → mime
Lightning 0.7 release notes say : "When installed in Thunderbird 1.5, Lightning can not read iMIP invitations sent from users of Apple iCal.app. However, this works correctly in Thunderbird 2.0. (bug 351997)" 

However, I am on Thunderbird version 2.0.0.9 (20071031) with Lightning 0.7 (build 2007102304) on a PC (Win XP) and am unable to receive invitations correctly from a mail sent from iCal:

The iCal invite is an emial with an ICS attachment. 
Here are the relevant message headers :
Content-Type: multipart/alternative; boundary=Apple-Mail-107-924246435
Mime-Version: 1.0 (Apple Message framework v915)
X-Mail-Calendar-Part: Yes
X-Mailer: Apple Mail (2.915)

I don't know what IMIP is, but if it helps, when I open the attachment in Sunbird, the event is created. Its just that Lightning does not see it as an invitation and does not allow me to respond to the invitation. Hope this helps.
There are also two other headers to the message : 

X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000 

Not sure what they mean, but am reporting them in case they help. Will be glad to carry out any tests if necessary. 
Here's the ICS file with names and emails changed..

BEGIN:VCALENDAR
PRODID:-//Apple Inc.//iCal 3.0//EN
CALSCALE:GREGORIAN
VERSION:2.0
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Pacific/Auckland
BEGIN:STANDARD
TZOFFSETFROM:+1300
TZOFFSETTO:+1200
DTSTART:19900318T030000
RRULE:FREQ=YEARLY;UNTIL=20070317T140000Z;BYMONTH=3;BYDAY=3SU
TZNAME:NZST
END:STANDARD
BEGIN:DAYLIGHT
TZOFFSETFROM:+1200
TZOFFSETTO:+1300
DTSTART:20070930T020000
RRULE:FREQ=YEARLY;BYMONTH=9;BYDAY=-1SU
TZNAME:NZDT
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+1300
TZOFFSETTO:+1200
DTSTART:20080406T030000
RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU
TZNAME:NZST
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
SEQUENCE:2
DTSTART;TZID=Pacific/Auckland:20071130T153000
DTSTAMP:20071127T013427Z
SUMMARY:1.8 showstopper meeting
ATTENDEE;CN="attendee1";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;ROLE=
 REQ-PARTICIPANT;RSVP=TRUE:mailto:person1@test.com
ATTENDEE;CN="attendee2";CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;
 ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:person2@test.com
ATTENDEE;CN="inviter";PARTSTAT=ACCEPTED:mailto:inviter@test.com
DTEND;TZID=Pacific/Auckland:20071130T160000
LOCATION:QA\n
TRANSP:OPAQUE
UID:590863D5-56DF-433B-B2FB-3FDD7FCD37F3
ORGANIZER;CN="Inviter Name":mailto:inviter@test.com
CREATED:20071118T234542Z
END:VEVENT
END:VCALENDAR
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: