File 0001-Backwards-compatibility-for-the-sync-protocol-withou.patch of Package cyrus-imapd-3
From d45b77b5d13108009c4ecd09bc15c032b527fdba Mon Sep 17 00:00:00 2001
From: Christian Mollekopf <mollekopf@apheleia-it.ch>
Date: Wed, 17 May 2023 18:16:09 +0200
Subject: [PATCH] Backwards compatibility for the sync protocol without MODSEQ
Required after 9d4d5069230d699c34e9c8410f0bd1df9ae3040a
---
imap/sync_support.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/imap/sync_support.c b/imap/sync_support.c
index f2699108a..0b43f15d0 100755
--- a/imap/sync_support.c
+++ b/imap/sync_support.c
@@ -1420,8 +1420,11 @@ int decode_annotations(/*const*/struct dlist *annots,
return IMAP_PROTOCOL_BAD_PARAMETERS;
if (!dlist_getatom(aa, "USERID", &userid))
return IMAP_PROTOCOL_BAD_PARAMETERS;
- if (!dlist_getnum64(aa, "MODSEQ", &modseq))
- return IMAP_PROTOCOL_BAD_PARAMETERS;
+ if (!dlist_getnum64(aa, "MODSEQ", &modseq)) {
+ // Backwards compat for cyrus 2.5
+ modseq = 0;
+ //return IMAP_PROTOCOL_BAD_PARAMETERS;
+ }
if (!dlist_getbuf(aa, "VALUE", &value))
return IMAP_PROTOCOL_BAD_PARAMETERS;
if (!strcmp(entry, IMAP_ANNOT_NS "thrid") &&
@@ -2997,9 +3000,9 @@ int sync_apply_mailbox(struct dlist *kin,
/* take all mailbox (not message) annotations - aka metadata,
* they're not versioned either */
if (ka)
- decode_annotations(ka, &mannots, mailbox, NULL);
+ r = decode_annotations(ka, &mannots, mailbox, NULL);
- r = read_annotations(mailbox, NULL, &rannots, 0, 0);
+ if (!r) r = read_annotations(mailbox, NULL, &rannots, 0, 0);
if (!r) r = apply_annotations(mailbox, NULL, rannots, mannots, 0, NULL);
if (r) {
--
2.40.0