Compare commits

...

2 Commits

4 changed files with 82 additions and 2 deletions

1
.evolution-ews.metadata Normal file
View File

@ -0,0 +1 @@
78072b4913ec2158de4aa6f3782891ea4146f3e7 evolution-ews-3.40.4.tar.xz

View File

@ -0,0 +1,71 @@
From 19678170eb8a36c67dabf4c7eb234a69f032d94b Mon Sep 17 00:00:00 2001
Date: Wed, 13 Dec 2023 12:16:45 +0100
Subject: [PATCH] I#250 - Mail: Calendar attachments can be broken by the
server
Closes https://gitlab.gnome.org/GNOME/evolution-ews/-/issues/250
---
src/EWS/camel/camel-ews-folder.c | 33 ++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/EWS/camel/camel-ews-folder.c b/src/EWS/camel/camel-ews-folder.c
index 84fdcf11..b1203489 100644
--- a/src/EWS/camel/camel-ews-folder.c
+++ b/src/EWS/camel/camel-ews-folder.c
@@ -344,7 +344,7 @@ ews_get_calendar_mime_part (CamelMimePart *mimepart)
}
static gchar *
-ews_update_mgtrequest_mime_calendar_itemid (const gchar *mime_fname,
+ews_update_mtgrequest_mime_calendar_itemid (const gchar *mime_fname,
const EwsId *calendar_item_id,
gboolean is_calendar_UID,
const EwsId *mail_item_id,
@@ -404,6 +404,35 @@ ews_update_mgtrequest_mime_calendar_itemid (const gchar *mime_fname,
if (ba && ba->len) {
g_byte_array_append (ba, (guint8 *) "\0", 1);
icomp = i_cal_parser_parse_string ((gchar *) ba->data);
+ if (!icomp) {
+ const gchar *content = (const gchar *) ba->data;
+ const gchar *begin_vcalendar, *end_vcalendar;
+
+ /* Workaround Office365.com error, which returns invalid iCalendar object (without 'END:VCALENDAR'),
+ in the MimeContent's text/calendar attachments as of 2023-12-12. */
+ begin_vcalendar = camel_strstrcase (content, "BEGIN:VCALENDAR");
+ end_vcalendar = camel_strstrcase (content, "END:VCALENDAR");
+
+ /* If it exists, then it should be alone on a separate line */
+ if (!(begin_vcalendar && (begin_vcalendar == content || begin_vcalendar[-1] == '\n') &&
+ (begin_vcalendar[15 /* strlen ("BEGIN:VCALENDAR") */] == '\r' || begin_vcalendar[15] == '\n')))
+ begin_vcalendar = NULL;
+
+ /* If it exists, then it should be alone on a separate line and not at the very beginning of the mime_content */
+ if (!(end_vcalendar && end_vcalendar > content && end_vcalendar[-1] == '\n' &&
+ (end_vcalendar[13 /* strlen ("END:VCALENDAR") */] == '\r' || end_vcalendar[13] == '\n' || end_vcalendar[13] == '\0')))
+ end_vcalendar = NULL;
+
+ if (begin_vcalendar && !end_vcalendar) {
+ g_byte_array_remove_index (ba, ba->len - 1);
+ #define add_str(_str) g_byte_array_append (ba, (guint8 *) _str, strlen (_str))
+ add_str ("\r\nEND:VCALENDAR\r\n");
+ #undef add_str
+ g_byte_array_append (ba, (guint8 *) "\0", 1);
+
+ icomp = i_cal_parser_parse_string ((const gchar *) ba->data);
+ }
+ }
}
if (icomp) {
ICalComponent *subcomp;
@@ -922,7 +951,7 @@ camel_ews_folder_get_message (CamelFolder *folder,
e_ews_additional_props_free (add_props);
g_slist_free (html_body_ids);
- mime_fname_new = ews_update_mgtrequest_mime_calendar_itemid (mime_content, calendar_item_accept_id, is_calendar_UID, e_ews_item_get_id (items->data), html_body, error);
+ mime_fname_new = ews_update_mtgrequest_mime_calendar_itemid (mime_content, calendar_item_accept_id, is_calendar_UID, e_ews_item_get_id (items->data), html_body, error);
if (mime_fname_new)
mime_content = (const gchar *) mime_fname_new;
--
2.41.0

View File

@ -5,13 +5,15 @@
%global libsoup_version 2.58
Name: evolution-ews
Version: 3.40.3
Version: 3.40.4
Release: 2%{?dist}
Summary: Evolution extension for Exchange Web Services
License: LGPLv2+
URL: https://wiki.gnome.org/Apps/Evolution
Source: http://download.gnome.org/sources/%{name}/3.40/%{name}-%{version}.tar.xz
Patch01: 0001-I-250-Mail-Calendar-attachments-can-be-broken-by-the.patch
%global eds_evo_version %{version}
Requires: evolution >= %{eds_evo_version}
@ -92,6 +94,12 @@ export CFLAGS="$RPM_OPT_FLAGS -Wno-deprecated-declarations"
%files langpacks -f %{name}.lang
%changelog
* Wed Dec 13 2023 Milan Crha <mcrha@redhat.com> - 3.40.4-2
- Resolves: RHEL-19371 (Backport upstream patch to workaround broken text/calendar mail attachments by the server)
* Fri Aug 13 2021 Milan Crha <mcrha@redhat.com> - 3.40.4-1
- Related: #1992450 (Update to 3.40.4)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3.40.3-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688

View File

@ -1 +1 @@
SHA512 (evolution-ews-3.40.3.tar.xz) = c35da74f1c52dabf1d3373654a70a7fa005cbc8ebb30a64c3315cffae222221a049918eb9821773020a7178c64caac0b9360ea562eda748b1e26911fcb4fcb90
SHA512 (evolution-ews-3.40.4.tar.xz) = 7f89e8cebf5931bd7d2f636b1780d914f069fb62ac4e14ad0ab2c9759e4553bc5d58a53b65a635c7b5be298fc017f375f9ca4d1c96002804093b9f47107455f2