Mail is not parsing calendar invites
Steps to reproduce
- Using a third party system (such as Google Calendar), send an invite to your configured email account in NextCloud
- After the invitation email has been received, click the email in the Mail app
- Observe that there are no options to accept or decline the invite
- Go to the Calendar app
- Observe that the invite does not appear automatically in the calendar
Expected behavior
The Mail app renders a section asking me to accept or decline the event.
The Mail app creates an unaccepted calendar invite in the Calendar app that can be accepted via connected CalDAV clients.
Actual behavior
The Mail app does not display an option to accept or decline an event.
The Calendar app does not show any tentative events.
Mail app version
5.0.0
Nextcloud version
31.0.3
Mailserver or service
Proton Mail (via ProtonMail-Bridge)
Operating system
Unraid
PHP engine version
PHP 8.3
Nextcloud memory caching
No response
Web server
Apache (supported)
Database
PostgreSQL
Additional info
I am not sure if this is similar / a duplicate of #10811
The portion around the Calendar app getting an invite as tentative does seem to duplicate #7750
Hi @geransmith
Can you attach a screen capture of what you are seeing when you click on the message?
Also, two things to double check,
A) the invitation needs to be in the future, B) the invitation must contain an attendee with the same email address as one of your configured email accounts
Hi @geransmith
Can you attach a screen capture of what you are seeing when you click on the message?
Also, two things to double check,
A) the invitation needs to be in the future, B) the invitation must contain an attendee with the same email address as one of your configured email accounts
Attached is what I see when I open the message (with blanking out my actual email addresses):
For sanity, I included the date/time in the screenshot to confirm the meeting invite is in the future.
The from address is from my work email. The to address matches what I have as the primary email on my user profile in Nextcloud and also matches one of the aliases in my mail account.
The from address is from my work email. The to address matches what I have as the primary email on my user profile in Nextcloud and also matches one of the aliases in my mail account.
Okay, its most likely something to do with non matching email addresses. I recently made some upgrades to the display prompt.
https://github.com/nextcloud/mail/pull/10970
This might not be released yet, but can you test this again after this patch has been installed
Okay, its most likely something to do with non matching email addresses. I recently made some upgrades to the display prompt.
The to address does match though.
Hi,
Thanks for reaching out. I'm sorry to hear that your Google Calendar invitation is not showing in Nextcloud Mail. iMIP (iCalendar Message-Based Interoperability Protocol, https://www.rfc-editor.org/rfc/rfc6047.html) is one of those never ending topics 🙈
I can replicate the problem with your example message and also with my ProtonMail account. It appears that ProtonMail is dropping method=REQUEST from the Content-Type header. The RFC is clear about this: a body with Content-Type: text/calendar without a method parameter is not considered to be an iMIP body part. Therefore, we are not treating it as such.
Apparently, the original invitation from Google had the method parameter, and knowing that ProtonMail breaks it doesn't help much. The same issue also applies to invitations from Outlook.com, so it's likely something that ProtonMail does when encrypting the incoming message.
Here's a patch that makes the Google invitation work through ProtonMail. I will discuss this patch with the team next week to determine if it's a viable way forward.
Index: lib/IMAP/ImapMessageFetcher.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/IMAP/ImapMessageFetcher.php b/lib/IMAP/ImapMessageFetcher.php
--- a/lib/IMAP/ImapMessageFetcher.php (revision be1c5d3ce39e8a9a67de514513d8ca8146f6d8c4)
+++ b/lib/IMAP/ImapMessageFetcher.php (date 1744915877559)
@@ -312,18 +312,25 @@
];
}
- // return if this is an event attachment only
- // the method parameter determines if this is a iMIP message
- if (!isset($allContentTypeParameters['method'])) {
- return;
+ $calendarContents = $this->loadBodyData($p, $partNo, $isFetched);
+ $upperCalendarContents = strtoupper($calendarContents);
+
+ if (str_contains($upperCalendarContents, 'METHOD:REQUEST')) {
+ $method = 'REQUEST';
+ } else if (str_contains($upperCalendarContents, 'METHOD:REPLY')) {
+ $method = 'REPLY';
+ } else if (str_contains($upperCalendarContents, 'METHOD:CANCEL')) {
+ $method = 'CANCEL';
+ } else {
+ $method = null;
}
- if (in_array(strtoupper($allContentTypeParameters['method']), ['REQUEST', 'REPLY', 'CANCEL'])) {
+ if ($method !== null) {
$this->scheduling[] = [
'id' => $p->getMimeId(),
'messageId' => $this->uid,
- 'method' => strtoupper($allContentTypeParameters['method']),
- 'contents' => $this->loadBodyData($p, $partNo, $isFetched),
+ 'method' => $method,
+ 'contents' => $calendarContents
];
return;
}
Index: lib/IMAP/MessageMapper.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/IMAP/MessageMapper.php b/lib/IMAP/MessageMapper.php
--- a/lib/IMAP/MessageMapper.php (revision be1c5d3ce39e8a9a67de514513d8ca8146f6d8c4)
+++ b/lib/IMAP/MessageMapper.php (date 1744912859146)
@@ -919,6 +919,9 @@
if ($part->getContentTypeParameter('method') !== null) {
$isImipMessage = true;
}
+ if ($part->getContentTypeParameter('name') === 'calendar.ics') {
+ $isImipMessage = true;
+ }
}
}
Awesome! This will be a HUGE help for me. I'll be happy to test it out once it is pushed to a release version.
I am going to open a ticket with ProtonMail. I feel like removing data from the header isn't the best behavior.
Hey @kesselb
+ $calendarContents = $this->loadBodyData($p, $partNo, $isFetched);
+ $upperCalendarContents = strtoupper($calendarContents);
+
+ if (str_contains($upperCalendarContents, 'METHOD:REQUEST')) {
+ $method = 'REQUEST';
+ } else if (str_contains($upperCalendarContents, 'METHOD:REPLY')) {
+ $method = 'REPLY';
+ } else if (str_contains($upperCalendarContents, 'METHOD:CANCEL')) {
+ $method = 'CANCEL';
+ } else {
+ $method = null;
}
Can we please not search the attachments for keywords this is not a good way to do this.
+ if ($part->getContentTypeParameter('name') === 'calendar.ics') {
+ $isImipMessage = true;
+ }
Also searching emails for specific filenames is not the way to solve this.
I'm facing the same problem. I'm connected to Mail using address already part of the invitation however, I'm still getting the same error message:
And, clicking on Yes, doesn't yield anything:
+1
It would also be helpful if the nextcloud staff could clarify where the registered email address must be.....is it in the nextcloud mail app (where we configure IMAP settings) or is it in the nextcloud sever under "accounts".
For me, I have the email address in both locations and still get this message:
This message has an attached invitation but the invitation does not contain a participant that matches any configured mail account address
Nextcloud 32, Nextcloud mail 5.5.7
@Luncheon3462
The invitation processing is actually part of the server dav code, the mail app just forwards the data.
Actually on that thought are you talking about the message when you open the email or is the error message in your logs?
Can you share the invitation and your email address with me. [email protected]
I was referring to the message when i open the email. But i do have mail app errors in my logs. Those errors don't seem to be related to processing the invitation though.
Can you clarify for me whether the mail account referenced with the message "This message has an attached invitation but the invitation does not contain a participant that matches any configured mail account address" refers to email addresses used in the mail app (by configuration of IMAP settings) or the email address configured as an account in the nextcloud server?
I tried many different calendar invitations......sent to email addresses used by big tech companies, but also to private domains. however, they were all initiated by Microsoft Office 365.
the email address configured as an account in the nextcloud server
This. We are aware of that limitation, and it's on our roadmap to improve it.
Interestingly, I also added those email addresses as accounts in the nextcloud server and still got the error message.