From: Timo Sirainen Date: Tue, 10 Nov 2020 22:11:35 +0000 (+0200) Subject: dsync: Fix UID renumbering when GUIDs aren't used X-Git-Tag: 2.3.14.rc1~341 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a6f9517c5c7cc71e0442f2ae4f34dde47b972c5;p=thirdparty%2Fdovecot%2Fcore.git dsync: Fix UID renumbering when GUIDs aren't used Mails that have local UIDs won't be in import_uids hash table, so they're not otherwise being iterated at the end and checked if they need renumbering. --- diff --git a/src/doveadm/dsync/dsync-mailbox-import.c b/src/doveadm/dsync/dsync-mailbox-import.c index b96a56008e..cab057b569 100644 --- a/src/doveadm/dsync/dsync-mailbox-import.c +++ b/src/doveadm/dsync/dsync-mailbox-import.c @@ -2227,7 +2227,7 @@ dsync_mailbox_import_handle_local_mails(struct dsync_mailbox_importer *importer) struct hash_iterate_context *iter; const char *key; void *key2; - struct importer_new_mail *mail; + struct importer_new_mail *mail, *const *mailp; if (importer->virtual_all_box != NULL && hash_table_count(importer->import_guids) > 0) { @@ -2252,6 +2252,13 @@ dsync_mailbox_import_handle_local_mails(struct dsync_mailbox_importer *importer) } T_END; } hash_table_iterate_deinit(&iter); + if (!importer->mails_have_guids) { + array_foreach(&importer->newmails, mailp) { + mail = *mailp; + if (mail->uid_in_local) + (void)dsync_mailbox_import_handle_mail(importer, mail); + } + } } int dsync_mailbox_import_changes_finish(struct dsync_mailbox_importer *importer)