From 051db9c68a7743d03f3f40ea39b87565cff7ff44 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 22 Sep 2016 13:38:33 +0300 Subject: [PATCH] dbox: mailbox_update() shouldn't reset pop3-uidl header. This broke reading migrated POP3 UIDLs. --- src/lib-storage/index/dbox-multi/mdbox-storage.c | 5 ++++- src/lib-storage/index/dbox-single/sdbox-storage.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib-storage/index/dbox-multi/mdbox-storage.c b/src/lib-storage/index/dbox-multi/mdbox-storage.c index 95585d0659..91e6fa3ce8 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-storage.c +++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c @@ -308,8 +308,11 @@ mdbox_write_index_header(struct mailbox *box, } mail_index_view_close(&view); - if (box->inbox_user) + if (box->inbox_user && box->creating) { + /* initialize pop3-uidl header when creating mailbox + (not on mailbox_update()) */ index_pop3_uidl_set_max_uid(box, trans, 0); + } mdbox_update_header(mbox, trans, update); if (new_trans != NULL) { diff --git a/src/lib-storage/index/dbox-single/sdbox-storage.c b/src/lib-storage/index/dbox-single/sdbox-storage.c index 05b42a313d..2dac9a81e9 100644 --- a/src/lib-storage/index/dbox-single/sdbox-storage.c +++ b/src/lib-storage/index/dbox-single/sdbox-storage.c @@ -263,8 +263,11 @@ int sdbox_mailbox_create_indexes(struct mailbox *box, update->min_highest_modseq); } - if (box->inbox_user) + if (box->inbox_user && box->creating) { + /* initialize pop3-uidl header when creating mailbox + (not on mailbox_update()) */ index_pop3_uidl_set_max_uid(box, trans, 0); + } sdbox_update_header(mbox, trans, update); if (new_trans != NULL) {