]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: mailbox_update() shouldn't reset pop3-uidl header.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 22 Sep 2016 10:38:33 +0000 (13:38 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 22 Sep 2016 10:38:33 +0000 (13:38 +0300)
This broke reading migrated POP3 UIDLs.

src/lib-storage/index/dbox-multi/mdbox-storage.c
src/lib-storage/index/dbox-single/sdbox-storage.c

index f9a461459436b29b112d6c1e526b38c02d3396b1..75678e26208a93ebefe2f9a34082abbfc84b5983 100644 (file)
@@ -310,8 +310,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) {
index 05b42a313de147c01a671b591f53470d436de24f..2dac9a81e9711d8214a917e50d4ccf4472122aa4 100644 (file)
@@ -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) {