Compare commits

...

No commits in common. 'c9' and 'c9-beta' have entirely different histories.
c9 ... c9-beta

@ -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

@ -0,0 +1,45 @@
From a80c55fee430452072540f06a1ae1271cd7a9650 Mon Sep 17 00:00:00 2001
Date: Tue, 31 Aug 2021 17:40:07 +0200
Subject: [PATCH] EEwsConnection: Release queue lock as soon as possible in
ews_next_request()
This could cause a deadlock when other thread cancels an ongoing
request (the ews_next_request() thread inside the e_ews_connection_utils_prepare_message())
and the ews_cancel_request() is called as the callback to the GCancellable::cancelled
signal.
---
src/EWS/common/e-ews-connection.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/EWS/common/e-ews-connection.c b/src/EWS/common/e-ews-connection.c
index 1ecacb19..0d7dcb25 100644
--- a/src/EWS/common/e-ews-connection.c
+++ b/src/EWS/common/e-ews-connection.c
@@ -711,22 +711,20 @@ ews_next_request (gpointer _cnc)
/* Add to active job queue */
cnc->priv->active_job_queue = g_slist_append (cnc->priv->active_job_queue, node);
+ QUEUE_UNLOCK (cnc);
+
if (cnc->priv->soup_session) {
SoupMessage *msg = SOUP_MESSAGE (node->msg);
if (!e_ews_connection_utils_prepare_message (cnc, NULL, msg, node->cancellable)) {
e_ews_debug_dump_raw_soup_request (msg);
- QUEUE_UNLOCK (cnc);
ews_response_cb (cnc->priv->soup_session, msg, node);
} else {
e_ews_debug_dump_raw_soup_request (msg);
soup_session_queue_message (cnc->priv->soup_session, msg, ews_response_cb, node);
- QUEUE_UNLOCK (cnc);
}
} else {
- QUEUE_UNLOCK (cnc);
-
ews_cancel_request (NULL, node);
}
--
GitLab

@ -6,12 +6,15 @@
Name: evolution-ews
Version: 3.40.4
Release: 1%{?dist}
Release: 3%{?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
Patch02: 0002-deadlock-on-op-cancel.patch
%global eds_evo_version %{version}
Requires: evolution >= %{eds_evo_version}
@ -92,6 +95,12 @@ export CFLAGS="$RPM_OPT_FLAGS -Wno-deprecated-declarations"
%files langpacks -f %{name}.lang
%changelog
* Mon Feb 12 2024 Milan Crha <mcrha@redhat.com> - 3.40.4-3
- Resolves: RHEL-25069 (Release queue lock as soon as possible in ews_next_request())
* 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)

Loading…
Cancel
Save