In another thread, Timo wrote:

On Mar 12, 2019, Timo Sirainen via dovecot <dovecot@dovecot.org> wrote:

> That bug is fixed with attached patch.

Thanks!  I'm attaching the patch here, so it is in this thread as well.

A couple of questions before I test this:

- Do I need the patch on the remote end of the sync, or the local end,
  or both?

- Does it make sense to try it based on the master-2.3 branch from git?
  Following https://wiki.dovecot.org/CompilingSource  ?

I'll report back once I've tested it.

Dan

>From 0ac59ec142bc9adc30f7d1c2c7c4cc0a109cbe15 Mon Sep 17 00:00:00 2001
From: Timo Sirainen <timo.sirai...@open-xchange.com>
Date: Fri, 8 Mar 2019 18:39:49 +0200
Subject: [PATCH] dsync: Fix importing keywords with MAIL_TRANSACTION_SYNC flag
 set

Reading transaction logs was handled differently depending on the
MAIL_TRANSACTION_SYNC flag. The flag was set for all transactions written
by dsync.

So for example:
 * doveadm backup mdbox:/tmp/mdbox1 # keywords imported ok
 * doveadm -o mail=mdbox:/tmp/mdbox1 backup mdbox:/tmp/mdbox2 # keywords lost
---
 src/doveadm/dsync/dsync-mailbox-import.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/doveadm/dsync/dsync-mailbox-import.c b/src/doveadm/dsync/dsync-mailbox-import.c
index 39a694a08a..98f54edb35 100644
--- a/src/doveadm/dsync/dsync-mailbox-import.c
+++ b/src/doveadm/dsync/dsync-mailbox-import.c
@@ -2314,6 +2314,7 @@ dsync_mailbox_get_final_keywords(const struct dsync_mail_change *change)
 	t_array_init(&keywords, count);
 	for (i = 0; i < count; i++) {
 		if (changes[i][0] == KEYWORD_CHANGE_ADD ||
+		    changes[i][0] == KEYWORD_CHANGE_FINAL ||
 		    changes[i][0] == KEYWORD_CHANGE_ADD_AND_FINAL) {
 			const char *name = changes[i]+1;
 
-- 
2.18.1

Reply via email to