From d3b7eeff467247b06457675e5b664dba6ee3fbde485b5bebd9451905059a9287 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 21 Dec 2022 07:28:56 +0000 Subject: [PATCH] Accepting request 1043991 from home:thiagomacieira - Add support for Zstandard (zstd) to the compression (zlib) plugin: zstd has a better compression ratio than gzip for the same amount of CPU work, or takes less CPU to compress the same. It's also faster to decompress. - Add dovecot-2.3.19-fix-doveadm-sync-special-folders.patch: Patches from the release-2.3 branch that fix issues importing the INBOX folder from a Cyrus IMAP server and dealing with auto-creating folders that haven't yet been created OBS-URL: https://build.opensuse.org/request/show/1043991 OBS-URL: https://build.opensuse.org/package/show/server:mail/dovecot23?expand=0&rev=108 --- ....19-fix-doveadm-sync-special-folders.patch | 81 +++++++++++++++++++ dovecot23.changes | 11 +++ dovecot23.spec | 12 +++ 3 files changed, 104 insertions(+) create mode 100644 dovecot-2.3.19-fix-doveadm-sync-special-folders.patch diff --git a/dovecot-2.3.19-fix-doveadm-sync-special-folders.patch b/dovecot-2.3.19-fix-doveadm-sync-special-folders.patch new file mode 100644 index 0000000..27692c7 --- /dev/null +++ b/dovecot-2.3.19-fix-doveadm-sync-special-folders.patch @@ -0,0 +1,81 @@ +From b05564d1575158cb011b4a66a37eccc926fe55db Mon Sep 17 00:00:00 2001 +From: Timo Sirainen +Date: Fri, 4 Nov 2022 14:01:14 +0200 +Subject: [PATCH 1/2] imapc: Fix listing INBOX when INBOX is already the + namespace prefix + +This especially caused problems when using dsync with imapc, resulting in +"Remote lost mailbox GUID" errors. +--- + src/lib-storage/index/imapc/imapc-list.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/lib-storage/index/imapc/imapc-list.c b/src/lib-storage/index/imapc/imapc-list.c +index a9e03ecf02..d987538df2 100644 +--- a/src/lib-storage/index/imapc/imapc-list.c ++++ b/src/lib-storage/index/imapc/imapc-list.c +@@ -754,7 +754,9 @@ imapc_list_iter_next(struct mailbox_list_iterate_context *_ctx) + if (node == NULL) + return mailbox_list_iter_default_next(_ctx); + } while ((node->flags & MAILBOX_MATCHED) == 0 || +- imapc_list_is_ns_root(ctx, node)); ++ (imapc_list_is_ns_root(ctx, node) && ++ (strcasecmp(vname, "INBOX") != 0 || ++ (ctx->info.ns->flags & NAMESPACE_FLAG_INBOX_ANY) == 0))); + + if (ctx->info.ns->prefix_len > 0 && + strcasecmp(vname, "INBOX") != 0 && +-- +2.38.1 + + +From 8fb6b9e1b847e6a0dc4f73d5d8cfb178830a282e Mon Sep 17 00:00:00 2001 +From: Timo Sirainen +Date: Thu, 3 Nov 2022 17:40:28 +0200 +Subject: [PATCH 2/2] dsync: Skip autocreated mailboxes that haven't been + created yet + +--- + src/doveadm/dsync/dsync-mailbox-tree-fill.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/src/doveadm/dsync/dsync-mailbox-tree-fill.c b/src/doveadm/dsync/dsync-mailbox-tree-fill.c +index c523e6bdc5..17c1eea0e5 100644 +--- a/src/doveadm/dsync/dsync-mailbox-tree-fill.c ++++ b/src/doveadm/dsync/dsync-mailbox-tree-fill.c +@@ -79,6 +79,7 @@ static int dsync_mailbox_tree_add(struct dsync_mailbox_tree *tree, + { + struct dsync_mailbox_node *node; + struct mailbox *box; ++ enum mailbox_existence existence; + struct mailbox_metadata metadata; + struct mailbox_status status; + const char *errstr; +@@ -94,8 +95,23 @@ static int dsync_mailbox_tree_add(struct dsync_mailbox_tree *tree, + + /* get GUID and UIDVALIDITY for selectable mailbox */ + box = mailbox_alloc(info->ns->list, info->vname, MAILBOX_FLAG_READONLY); +- if (dsync_mailbox_tree_get_selectable(box, &metadata, &status) < 0) { ++ ret = mailbox_exists(box, FALSE, &existence); ++ if (ret == 0 && existence != MAILBOX_EXISTENCE_SELECT) { ++ /* autocreated mailbox doesn't exist yet */ ++ mailbox_free(&box); ++ if (existence == MAILBOX_EXISTENCE_NOSELECT) { ++ return !guid_128_is_empty(box_guid) ? 0 : ++ dsync_mailbox_tree_add_exists_node( ++ tree, info, &node, error_r); ++ } else { ++ return 0; ++ } ++ } ++ if (ret == 0) ++ ret = dsync_mailbox_tree_get_selectable(box, &metadata, &status); ++ if (ret < 0) { + errstr = mailbox_get_last_internal_error(box, &error); ++ ret = 0; + switch (error) { + case MAIL_ERROR_NOTFOUND: + /* mailbox was just deleted? */ +-- +2.38.1 + diff --git a/dovecot23.changes b/dovecot23.changes index ef1e7ef..21a0186 100644 --- a/dovecot23.changes +++ b/dovecot23.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Dec 20 22:30:25 UTC 2022 - Thiago Macieira + +- Add suppor for Zstandard (zstd) to the compression (zlib) plugin: zstd has a + better compression ratio than gzip for the same amount of CPU work, or takes + less CPU to compress the same. It's also faster to decompress. +- Add dovecot-2.3.19-fix-doveadm-sync-special-folders.patch: + Patches from the release-2.3 branch that fix issues importing the INBOX + folder from a Cyrus IMAP server and dealing with auto-creating folders that + haven't yet been created + ------------------------------------------------------------------- Tue Jun 14 14:17:29 UTC 2022 - Michael Ströder diff --git a/dovecot23.spec b/dovecot23.spec index 7e31010..4767782 100644 --- a/dovecot23.spec +++ b/dovecot23.spec @@ -58,6 +58,11 @@ Release: 0 %bcond_with argon %bcond_with lz4 %endif +%if 0%{?suse_version} >= 1110 +%bcond_without zstd +%else +%bcond_with zstd +%endif BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: cyrus-sasl-devel @@ -73,6 +78,9 @@ BuildRequires: xz-devel %if %{with lz4} BuildRequires: liblz4-devel %endif +%if %{with zstd} +BuildRequires: libzstd-devel +%endif %if %{with argon} BuildRequires: libsodium-devel %endif @@ -152,6 +160,7 @@ Source11: https://pigeonhole.dovecot.org/releases/%{dovecot_branch}/%{dove Source12: dovecot23.keyring Patch: dovecot-2.3.0-dont_use_etc_ssl_certs.patch Patch1: dovecot-2.3.0-better_ssl_defaults.patch +Patch2: dovecot-2.3.19-fix-doveadm-sync-special-folders.patch Summary: IMAP and POP3 Server Written Primarily with Security in Mind License: BSD-3-Clause AND LGPL-2.1-or-later AND MIT Group: Productivity/Networking/Email/Servers @@ -377,6 +386,9 @@ export LIBS="-pie" %endif %if %{with lz4} --with-lz4 \ +%endif +%if %{with zstd} + --with-zstd \ %endif --with-libcap \ --with-libwrap \