nextcloud / mail

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

Inconsistent behaviour for incoming ics calender events #9604

Open beccon4 opened 6 months ago

beccon4 commented 6 months ago

Steps to reproduce

  1. send a calendar invitation from an external calendar e.g. Outlook or Kopana
  2. attach the same ics file to an email and send it too
  3. compare the different behaviour - the first one resulting in not being able to import the event into the own calendar

Expected behavior

Nextcloud mail behaves consistently in both cases - or at least allows to import always.

Actual behavior

When sent as an attachment using a standard mail program, ics files appear as an email attachment and can be imported into the calendar:

image

But when issued from an external calender / PIM system such as Outlook or in this case Kopana the result ist different:

image

In this case, the Mail App recognises the ics attachment as a calendar event and displays it nicely. Unfortunately there is no way to add it to my calendar. BTW: In the ... menu there is a "create event" in the 2nd level but this does not take the event's date and time but creates an event for the actual time. There is another menu item to create a task right below - so it seems these are something else.

Mail app version

3.6.0

Mailserver or service

No response

Operating system

No response

PHP engine version

PHP 8.0

Web server

Apache (supported)

Database

MySQL

Additional info

Lets's have a look into the sources:

case 1 sent from Kopana

Return-Path: <prvs=08458d4b7d=t.****@*****.de>
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
    lvps***-***-***-***.dedicated.hosteurope.de
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=7.0 tests=BAYES_00,MIME_QP_LONG_LINE,
    URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2
X-Original-To: **@****.de
Delivered-To: **@****.de
Received: from vpn1.****.de (vpn1.****.de [***.***.***.***])
    by lvps***-***-***-***.dedicated.hosteurope.de (Postfix) with ESMTPS id A1AD31F38D
    for <**@****.de>; Thu, 25 Apr 2024 10:11:40 +0200 (CEST)
Received: from [***.***.***.***] (port=57528 helo=mail02.corp.****.de)
    by ****.****.de with esmtpsa  (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
    (Exim 4.96)
    (envelope-from <****@****.de>)
    id 1rzuCf-0003Xx-2X
    for ****@****.de;
    Thu, 25 Apr 2024 10:11:37 +0200
Received: from localhost (localhost [127.0.0.1])
    by mail02.corp.****.de (Postfix) with ESMTP id BA31E700C3E
    for <****@****.de>; Thu, 25 Apr 2024 10:11:37 +0200 (CEST)
X-SASI-Hits: BODYTEXTP_SIZE_3000_LESS 0.000000,
    BODYTEXTP_SIZE_400_LESS 0.000000, BODY_SIZE_2000_2999 0.000000,
    BODY_SIZE_5000_LESS 0.000000, BODY_SIZE_7000_LESS 0.000000,
    CALENDAR_ATTACHED 0.000000, FROM_SAME_AS_TO_DOMAIN 0.000000,
    HTML_00_01 0.050000, HTML_00_10 0.050000, MIME_LOWER_CASE 0.050000,
    MIME_TEXT_ONLY_MULTI 0.000000, NO_FUR_HEADER 0.000000, OUTBOUND 0.000000,
    OUTBOUND_SOPHOS 0.000000, SENDER_NO_AUTH 0.000000, TO_NAME_IS_ADDY 0.000000,
    TRANSACTIONAL 0.000000, URI_WITH_PATH_ONLY 0.000000,
    X_PRIORITY_HIGH 0.000000, __ANY_URI 0.000000, __ATTACHMENT_NOT_IMG 0.000000,
    __ATTACH_CTE_8BIT 0.000000, __ATTACH_CTE_QUOTED_PRINTABLE 0.000000,
    __BODY_NO_MAILTO 0.000000, __BULK_NEGATE 0.000000,
    __CALENDAR_ATTACHED4 0.000000, __CP_URI_IN_BODY 0.000000, __CT 0.000000,
    __CTYPE_HAS_BOUNDARY 0.000000, __CTYPE_MULTIPART 0.000000,
    __CTYPE_MULTIPART_ALT 0.000000, __DQ_NEG_DOMAIN 0.000000,
    __DQ_NEG_HEUR 0.000000, __DQ_NEG_IP 0.000000,
    __FROM_DOMAIN_IN_ANY_TO1 0.000000, __FROM_DOMAIN_IN_RCPT 0.000000,
    __FROM_DOMAIN_NOT_IN_BODY 0.000000, __FROM_NAME_NOT_IN_BODY 0.000000,
    __FUR_RDNS_SOPHOS 0.000000, __HAS_FROM 0.000000, __HAS_MSGID 0.000000,
    __HAS_X_MAILER 0.000000, __HAS_X_PRIORITY 0.000000,
    __HEADER_ORDER_FROM 0.000000, __HELO_LOCALHOST 0.000000,
    __HELO_LOCALHOST1 0.000000, __HIGHBIT_ASCII_MIX 0.000000,
    __HTTPS_URI 0.000000, __MIME_TEXT_ONLY 0.000000, __MIME_TEXT_P 0.000000,
    __MIME_TEXT_P1 0.000000, __MIME_TEXT_P2 0.000000, __MIME_VERSION 0.000000,
    __MULTIPLE_RCPTS_TO_X2 0.000000, __MULTIPLE_URI_TEXT 0.000000,
    __NO_HTML_TAG_RAW 0.000000, __OUTBOUND_SOPHOS_FUR 0.000000,
    __OUTBOUND_SOPHOS_FUR_IP 0.000000, __OUTBOUND_SOPHOS_FUR_RDNS 0.000000,
    __PASSWORD_IN_BODY 0.000000, __RCPT_DOMAIN_NOT_TO 0.000000,
    __RCVD_FROM_DOMAIN 0.000000, __RCVD_FROM_SUSP_HOSTNAME 0.000000,
    __SANE_MSGID 0.000000, __SUBJ_HIGHBIT 0.000000,
    __SUBJ_TRANSACTIONAL 0.000000, __SUBJ_TR_GEN 0.000000,
    __TO_DOMAIN_IN_FROM 0.000000, __TO_HOST_IN_FROM 0.000000,
    __TO_MALFORMED_2 0.000000, __TO_NAME 0.000000,
    __TO_NAME_DIFF_FROM_ACC 0.000000, __TO_NO_NAME 0.000000,
    __TO_REAL_NAMES 0.000000, __URI_IN_BODY 0.000000, __URI_NOT_IMG 0.000000,
    __URI_NO_MAILTO 0.000000, __URI_NO_WWW 0.000000, __URI_NS 0.000000,
    __URI_WITH_PATH 0.000000, __UTF8_SUBJ 0.000000, __X_VIRUS_SCANNED 0.000000
X-SASI-Probability: 8%
X-SASI-RCODE: 200
X-SASI-Version: Antispam-Engine: 5.1.4, AntispamData: 2024.4.25.72716
X-Virus-Scanned: by amavisd-new-2.11.0 (20160426) (Debian) at
    corp.****.de
Received: from mail02.corp.****.de ([127.0.0.1])
    by localhost (mail02.corp.****.de [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id NmG0BOI2pu2O; Thu, 25 Apr 2024 10:11:37 +0200 (CEST)
Received: from mail02.corp.****.de (localhost [127.0.0.1])
    by mail02.corp.****.de (Postfix) with ESMTP id 86EEF700C1E;
    Thu, 25 Apr 2024 10:11:37 +0200 (CEST)
Received: by mail02 (kopano-spooler) with MAPI; Thu, 25 Apr 2024 10:11:37
 +0200
Subject: =?UTF-8?Q?Canceled=3A_DWH-Projekt_-_Kl=C3=A4rung_der_Datenanforde?=
 =?UTF-8?Q?rungen_=28Folge=29?=
From: "**** ****" <t.****@****.de>
To: =?us-ascii?Q?****=40****=2Ede?= <****@****.de>, "**** ****"
  <****@****.de>
Date: Thu, 25 Apr 2024 08:11:37 +0000
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="=_V0xa8z-kV9WRMnXWg-pZNrGLTwxMxbYM87QbV5XxMX7BhWr6"
X-Priority: 1 (Highest)
X-Mailer: Kopano 8.7.25
Message-Id: <kcEE.ZPP5nVACQUe1pDeO6+MRGg.gAKgMeiW2gE@mail02.corp.****.de>

This is a multi-part message in MIME format. Your mail reader does not
understand MIME message format.
--=_V0xa8z-kV9WRMnXWg-pZNrGLTwxMxbYM87QbV5XxMX7BhWr6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Wann: Donnerstag 25. April 2024 11:00 - Donnerstag 25. April 2024 12:00
Wo: Zoom (https://us02web.zoom.us/j/********)

*~*~*~*~*~*~*~*~*~*

https://us02web.zoom.us/j/*******
--=_V0xa8z-kV9WRMnXWg-pZNrGLTwxMxbYM87QbV5XxMX7BhWr6
Content-Type: text/calendar; method=CANCEL; charset=utf-8
Content-Transfer-Encoding: 8bit

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Kopano//8.7.25//EN
CALSCALE:GREGORIAN
METHOD:CANCEL
BEGIN:VEVENT
STATUS:CANCELLED

case 2 (attachment sent - import works)

X-Original-To: ****@****.de
Delivered-To: ****@****.de
Received: from wolke.****.de (unknown [***.***.***.***])
    by lvps***-***-***-***.dedicated.hosteurope.de (Postfix) with ESMTPSA id 79ECE1F38D
    for <****@****.de>; Thu, 25 Apr 2024 20:13:42 +0200 (CEST)
MIME-Version: 1.0
Date: Thu, 25 Apr 2024 18:13:42 +0000
Content-Type: multipart/mixed;
 boundary="4faf01c3-1b03-4503-a800-5b509913ead2-1"
From: ****@****.de
Message-ID: <4bf29077b820dafd07c5fbe9df253c0df869d12e@****.de>
TLS-Required: No
Subject: Kopano
To: ****@*****.de

--4faf01c3-1b03-4503-a800-5b509913ead2-1
Content-Type: multipart/alternative;
 boundary="044fa952-1ca8-4e36-ba5d-dfedd1fc2825-2"

--044fa952-1ca8-4e36-ba5d-dfedd1fc2825-2
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

--044fa952-1ca8-4e36-ba5d-dfedd1fc2825-2
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html><html><head><meta http-equiv=3D"Content-Type" content=3D"t=
ext/html; charset=3Dutf-8"></head><body><br></body></html>
--044fa952-1ca8-4e36-ba5d-dfedd1fc2825-2--

--4faf01c3-1b03-4503-a800-5b509913ead2-1
Content-Type: text/calendar; name="events-kopano.ics"
Content-Disposition: attachment; filename="events-kopano.ics"
Content-Transfer-Encoding: base64

QkVHSU46VkNBTEVOREFSDQpWRVJTSU9OOtIuMA0KUFJPRElEOi0vL0tvcGFuby8vOC43LjI1
Ly9FTg0KQ0FMU0NBTEU6R1JFR09SSUFODQfNRVRIT0Q6UkVRVUVTVA0KQkVHSU46VkVWRU5U
DQpTVEFUVVM6Q09ORklSTUVEDQpBVFRFTdRFRTtST0xFPVJFUS1QQVJUSUNJUEFOVDtQQVJU
U1RBVD1ORUVEUy1BQ1RJT047UlNWUD1UUlVFO0NOPU1hcnRhIA0KIFdpY2hsaW5za2E6bWFp ...

Unfortunately case 1 appears more often - case 2 I created myself after learning that importing calendar events should work. They do, but not always :-)

beccon4 commented 2 months ago

I still have this issue - if you do not think, that this is an error, please close but don't ignore.

ChristophWurst commented 2 months ago

@kesselb is this related to the bug you were hunting?

kesselb commented 2 months ago

Looks related.

The issue I try to solve with https://github.com/nextcloud/mail/pull/10057 is the an imip invitation sent through the new mail provider backend is not recognized as imip invitation because the method=X part is lost.

Content-Type: text/calendar; name="events-kopano.ics"

The attachment sent by the mail client is not using the right mime type and hence the attachment is not considered as imip body: https://www.rfc-editor.org/rfc/rfc6047#section-2.4.

I did a quick test with Gmail (export event in Nextcloud, manually send with Mail to my gmail address) and their imip preview is shown.

Even for an event without a method header (content type) and without a method property (in the ics file) the imip preview is shown and therefore it looks like a reasonable enhancement to be less strict.

ChristophWurst commented 1 month ago

Yep, let's relax the check

beccon4 commented 1 month ago

Vielen Dank :-)

Luncheon3462 commented 3 weeks ago

Following