From: Timo Sirainen Date: Thu, 22 Sep 2016 10:38:33 +0000 (+0300) Subject: dbox: mailbox_update() shouldn't reset pop3-uidl header. X-Git-Tag: 2.2.26~235 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=051db9c68a7743d03f3f40ea39b87565cff7ff44;p=thirdparty%2Fdovecot%2Fcore.git dbox: mailbox_update() shouldn't reset pop3-uidl header. This broke reading migrated POP3 UIDLs. --- 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) {