server icon indicating copy to clipboard operation
server copied to clipboard

Calendar Invites - Outlook integration

Open hdijkema opened this issue 7 years ago • 13 comments

Steps to reproduce

  1. Create a Calendar Invite in Thunderbird - invite someone who's using Outlook 2010.
  2. Create a similar Calendar Invite in Nextcloud - invite same person using Outlook 2010

Expected behaviour

I expect the same behaviour as with Outlook 2016, i.e. the invite gives me buttons on top of the invite and show me the calendar of Outlook/Exchange. However, with the thunderbird invite and invites from google, they are shown; but not with the invites from nextcloud. Thunderbird/nextcloud invites come from the same domain.

image

Actual behaviour

No buttons are shown. image

Server configuration

Operating system: Ubuntu 18

Web server: Apache2

Database: PostgreSQL 9.5

PHP version: 7.2

Nextcloud version: (see Nextcloud admin page) 14.x

Updated from an older Nextcloud/ownCloud or fresh install: Updated

Where did you install Nextcloud from: Web

hdijkema avatar Dec 06 '18 14:12 hdijkema

I investigated the issue, by looking at the email that nextcloud sends. The difference between google, thunderbird and nextcloud is that nextcloud doesn't send a plain text/calendar mime part. So I setup a telnet session with my postfix smtp daemon, pasted the whole nextcloud invite without the last mime boundary and added the base64 decoded VCALENDAR item in plain text:

--_=_swift_1544110679_5950e85027774b8eec65f40de781557c_=_
Content-Type: text/calendar; method=REQUEST; charset="UTF-8"
Content-Transfer-Encoding: 7bit

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.1.2//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
CREATED:20181206T163735
DTSTAMP:20181206T163735
LAST-MODIFIED:20181206T163735
UID:WNUPZ1W3AHH5D2G3STLBCS
SUMMARY:KLOP
ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;CUTYPE=INDIVI
 DUAL:mailto:[email protected]
ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;CUTYPE=INDIVI
 DUAL:mailto:[email protected]
ORGANIZER;CN=Hans Dijkema:mailto:[email protected]
CLASS:PUBLIC
STATUS:CONFIRMED
DTSTART;VALUE=DATE:20181209
DTEND;VALUE=DATE:20181210
END:VEVENT
END:VCALENDAR

--_=_swift_1544110679_5950e85027774b8eec65f40de781557c_=_--

And voilà! Outlook 2010 understands the message and provides accept/decline/tentative buttons.

hdijkema avatar Dec 06 '18 16:12 hdijkema

I did some patching in nextcloud 14.0.4; Patched following files to make nextcloud invite compliant with Outlook 2010:

  • lib/public/Mail/IMessage.php
  • lib/private/Mail/Message.php
  • apps/dav/lib/CalDAV/Schedule/IMipPlugin.php

IMessage.php

        public function attach(IAttachment $attachment): IMessage;

        # ADDED HD
        public function addPart($body, $content_type = null, $charset = null): IMessage;
        # ADDED HD

        /**

Message.php

        public function attach(IAttachment $attachment): IMessage {
                /** @var Attachment $attachment */
                $this->swiftMessage->attach($attachment->getSwiftAttachment());
                return $this;
        }

        # ADDED HD
        public function addPart($data, $content_type = null, $charset = null): IMessage {
               $this->swiftMessage->addPart($data, $content_type, $charset);
               return $this;
        }
        # ADDED HD

        /**

IMipPlugin.php

                # REMOVED HD
                #$attachment = $this->mailer->createAttachment(
                #       $iTipMessage->message->serialize(),
                #       'event.ics',// TODO(leon): Make file name unique, e.g. add event id
                #       'text/calendar; method=' . $iTipMessage->method
                #);
                #$message->attach($attachment);
                # REMOVED HD

                # ADDED HD
                $message->addPart(
                        $iTipMessage->message->serialize(),
                        'text/calendar; method=' . $iTipMessage->method,
                        'UTF-8'
                );
                # ADDED HD

                try {
 

Tested this solution with

  • gmail/google calendar
  • Outlook 2016 (Office 365)
  • Outlook 2010
  • Thunderbird with Lightning

And it worked.

hdijkema avatar Dec 07 '18 00:12 hdijkema

@hdijkema Thanks for already looking into a solution. It would be great if you could open a pull request for that.

cc @georgehrke

juliusknorr avatar Dec 07 '18 10:12 juliusknorr

I need a little help here. How do I do that?

hdijkema avatar Dec 07 '18 10:12 hdijkema

@hdijkema Hey, thanks for the deep analysis and the fix. GitHub provides a great documentation on how to send a pull-request: https://help.github.com/articles/creating-a-pull-request-from-a-fork/

If you have any issues, please don't hesitate to ask for help. :)

georgehrke avatar Dec 07 '18 10:12 georgehrke

I think I created a pull. https://github.com/nextcloud/server/pull/12921

Tried it again: #12946

hdijkema avatar Dec 07 '18 20:12 hdijkema

I suppose this issue is still valid? If not, please close this issue!

szaimen avatar May 26 '21 12:05 szaimen

I don't use Nextcloud anymore. I don't know.

hdijkema avatar May 26 '21 12:05 hdijkema

This issue is still valid, unfortunately.

averymd avatar May 28 '21 13:05 averymd

Please reopen this issue. I found this ticket because i was missing this feature.

mkbrechtel avatar Jan 06 '22 09:01 mkbrechtel

Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!

szaimen avatar Jan 09 '23 12:01 szaimen

@szaimen : Invites sent from NC 25.0.3 to outlook still show as (attached) event.ics file 😢

AbelLykens avatar Jan 26 '23 10:01 AbelLykens

Fix in #36118 is not yet merged indeed.

tcitworld avatar Jan 26 '23 11:01 tcitworld