]> 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 11:44:51 +0000 (14:44 +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 95585d0659047e101071fc1407af93600672e747..91e6fa3ce87e0f0e9e19c1b528e6577903c7c6a9 100644 (file)
@@ -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) {
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) {