nextcloud / mail

💌 Mail app for Nextcloud
https://apps.nextcloud.com/apps/mail
GNU Affero General Public License v3.0
852 stars 264 forks source link

text/calendar attachment not shows as event #2524

Open strenker opened 4 years ago

strenker commented 4 years ago

Expected behavior

Tell us what should happen

Calendar Invitations send from MS-Exchange-Servers should be recognized so that they could be imported into the calendar like other Invitation E-Mails as well.

Actual behavior

Calendar Invitations from MS-Exchange-Servers are not recognized. Not even the ICS-Attachment is shown as E-Mail-Attachment.

Mail app

Mail app version: 1.0.0

Mailserver or service: Self-Hosted MailPlus-Server 2.1.2-0705 on Synology-NAS

Server configuration

Operating system: Synology DSM 6.2.2-24922 Update 4 on Synology NAS DS718+

Web server: Apache 2.4 on Synology NAS

Database: MariaDB 10 on Synology NAS

PHP version: 7.2

Nextcloud Version: 18.0.0

Client configuration

Browser: Firefox 68.4.1esr (64-Bit) on Gentoo Linux

Operating system: Gentoo Linux Test-Invitation-Email-from-Exchange-Server.txt

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/87371991-text-calendar-attachment-not-shows-as-event?utm_campaign=plugin&utm_content=tracker%2F44154351&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F44154351&utm_medium=issues&utm_source=github).
ChristophWurst commented 4 years ago

Duplicate of https://github.com/nextcloud/mail/issues/160

ChristophWurst commented 4 years ago

MIME detction should be fixed as of https://github.com/nextcloud/mail/pull/2268/files#r349009008. If the ICS still doesn't show up as calendar event then please inspect the message source and see what MIME is set for the attachment part.

strenker commented 4 years ago

Hi,

I am sorry, but it does not work. Maybe this happens because the name-Tag for the Attachment is missing or because the text/calendar-attachement itself is not plain text but base64 encoded.

The original E-Mail containing the Invitation from the MS-Exchange-Server is attached to my first message.

Kind regards Stefan

ChristophWurst commented 4 years ago

Thanks for the original message. text/calendar should be detected as calendar event and thus offer a calendar import.

eleith commented 4 years ago

@ChristophWurst

text/calendar is explicitly skipped per

https://github.com/nextcloud/mail/blob/master/lib/Model/IMAPMessage.php#L390

if i add in attachment handling instead of skipping it:

                if ($p->getType() === 'text/calendar') {
                        $this->attachments[] = [        
                                'id' => $p->getMimeId(),
                                'messageId' => $this->messageId,
                                'fileName' => $filename,
                                'mime' => $p->getType(),
                                'size' => $p->getBytes(),
                                'cid' => $p->getContentId()
                        ];
                        return;
                }

then i am able to download the appointment into the calendar. i'm assuming there might be other repercussions given it was explicitly skipped.

gmail sends both application/ics and text/calendar but other providers seem to only offer one or the other.

ChristophWurst commented 4 years ago

there might be other repercussions given it was explicitly skipped.

It was originally added at https://github.com/owncloudarchive/mail/pull/137 if that helps.

eleith commented 4 years ago

looks like it would be safe to add in. the handling for application/ics now exists and is good enough to be re-used for text/calendar.

the impact of adding it, is that services that send both attachments will render two attachments in the email. i think it is fine, it is something to be aware of.

i use roundcube currently and that is what they do (render both attachments).

koying commented 10 months ago

There hasn't been any progress on this one, was it? I don't want to seem demanding, but for a groupware that wants to be both integrated and professional, that is quite a feature hole.

I have to use roundcube as well to plainly download the ics, so that download part at least seem a bug to me