0

Using sabre/vobject library I am creating an ics file like this one:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.1.2//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
UID:sabre-vobject-d4b1ccb3-2197-4ee4-aab8-7bc2516adbf8
DTSTAMP:20170123T182612Z
SUMMARY:testev2
DESCRIPTION:
DTSTART;TZID=Europe/Athens:20170214T090000
DTEND;TZID=Europe/Athens:20170215T170000
LOCATION:
ORGANIZER;CN=Organizer Name:mailto:organizer@example.com
ATTENDEE;CN=Test User:MAILTO:test.user@somewhere.com
END:VEVENT
END:VCALENDAR

Then using phpmailer, I am attaching the file generated to an e-mail message and send it to the users who are participating on the event. Users who are using thunderbird (with Lightning extension - which is by default on) receive the e-mail message in the following format:

enter image description here

As you see in the picture the ics file is parsed and rendered in the table at the bottom of the e-mail. However the table header (the one marked in red) is not displaying correct information. Test user has not ever cofirmed his/her presence, and if he does, the ics file does not provide any info about it.

Am I formatting the ics file wrong?

Is it a known bug of thunderbird / Lightning ?

UPDATE The e-mail headers of the message:

Return-Path: <XXXXXXXXXXXXXXXX>
Received: from deliver ([unix socket])
     by mail (Cyrus v2.3.16-Fedora-RPM-2.3.16-13.el6_6) with LMTPA;
     Tue, 24 Jan 2017 12:48:10 +0200
X-Sieve: CMU Sieve 2.3
Received: from [XXX.XXX.XXX.XXX] (XXXXXXXXXXXXXX [XXX.XXX.XXX.XXX
    (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits))
    (No client certificate requested)
    by XXXXXXXXXXXXXX (Postfix) with ESMTPSA id 6F18C1BE0305
    for <XXXXXXXXXXXXXX>; Tue, 24 Jan 2017 12:48:10 +0200 (EET)
Subject: Fwd: Event invitation: testev2
To: "XXXXXXXX" <XXXXXXXXXXXXXX>
From: XXXXXXXXXXXXXX <XXXXXXXXXXXXXX>
X-Forwarded-Message-Id:
Message-ID: <bac7749e-9699-1b50-9de5-27a510c663a4@XXXXXXXX>
Date: Tue, 24 Jan 2017 12:48:09 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.6.0
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------79DD2A1D49F1A57579125B45"

This is a multi-part message in MIME format.
--------------79DD2A1D49F1A57579125B45
Content-Type: multipart/alternative;
 boundary="------------72E56459CD6D794D0DF5AC4B"

--------------72E56459CD6D794D0DF5AC4B
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
> ------- Forwarded Message --------
Forward message content
> --------------72E56459CD6D794D0DF5AC4B
> Content-Type: text/html; charset=windows-1252
> Content-Transfer-Encoding: 8bit
>
HTML Content
> --------------72E56459CD6D794D0DF5AC4B--
>
> --------------79DD2A1D49F1A57579125B45
> Content-Type: text/calendar;
>  name="invitation.ics"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: attachment;
>  filename="invitation.ics"
>
ICS Content
> --------------79DD2A1D49F1A57579125B45--
antoniom
  • 3,143
  • 1
  • 37
  • 53

1 Answers1

0

You should make the Content-Type of the ics attachment something like:

Content-Type: text/calendar; charset="utf-8"; method=REQUEST

The method option is the magic word. I'm not completely sure this works, but it is at least closer to the spec. I'm happy to update my answer if it doesn't work.

Philipp Kewisch
  • 982
  • 6
  • 20
  • I have changed the contents of the .eml file that I have in my hands from `Content-Type: text/calendar; name="invitation.ics"` to `Content-Type: text/calendar; charset="utf-8"; method=REQUEST` and the problem persists. What is interesting is that Thunderbird who is receiving the message is dropping the extra headers provided and keeps only `Content-Type: text/calendar;` – antoniom Jan 25 '17 at 13:52
  • Thunderbird does not usually make changes to headers. Can you verify that this is not dropped somewhere inbetween, e.g. in the backend code of phpmailer? You could also try dropping `Content-Disposition` from the text/calendar part. – Philipp Kewisch Jan 25 '17 at 15:11
  • @antoniom did you have a chance to check this? I'd appreciate if you could accept the answer if this was helpful to you. – Philipp Kewisch Apr 05 '17 at 10:44
  • @phillip-kewisch I have actually checked that, from the moment you sent it but it didn't solve my problem. In the next few weeks I will come back to this and send you more details. Thanks! – antoniom Apr 05 '17 at 11:06