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
This commit is contained in:
Dirk Mueller 2022-12-21 07:28:56 +00:00 committed by Git OBS Bridge
parent aca9b3f546
commit d3b7eeff46
3 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,81 @@
From b05564d1575158cb011b4a66a37eccc926fe55db Mon Sep 17 00:00:00 2001
From: Timo Sirainen <timo.sirainen@open-xchange.com>
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 <timo.sirainen@open-xchange.com>
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

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue Dec 20 22:30:25 UTC 2022 - Thiago Macieira <thiago@kde.org>
- 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 <michael@stroeder.com>

View File

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