]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: Initialize pop3-uidl header on INBOX creation.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 13 Jul 2016 20:10:57 +0000 (15:10 -0500)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 13 Jul 2016 20:10:57 +0000 (15:10 -0500)
This way we don't add any UIDLs to dovecot.index.cache on the first POP3
UIDL access. We'll assume that pop3-uidl header is updated whenever any
backend UIDLs are added, which should happen nowadays.

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

index a58bd736fb589d5ca7676614cb1708c57e4e2ed4..f9a461459436b29b112d6c1e526b38c02d3396b1 100644 (file)
@@ -9,6 +9,7 @@
 #include "mail-index-alloc-cache.h"
 #include "mailbox-log.h"
 #include "mailbox-list-private.h"
+#include "index-pop3-uidl.h"
 #include "dbox-mail.h"
 #include "dbox-save.h"
 #include "mdbox-map.h"
@@ -309,6 +310,9 @@ mdbox_write_index_header(struct mailbox *box,
        }
        mail_index_view_close(&view);
 
+       if (box->inbox_user)
+               index_pop3_uidl_set_max_uid(box, trans, 0);
+
        mdbox_update_header(mbox, trans, update);
        if (new_trans != NULL) {
                if (mail_index_transaction_commit(&new_trans) < 0) {
index 333c4aca46c7d31d001bc2f53365f13a894548c4..05b42a313de147c01a671b591f53470d436de24f 100644 (file)
@@ -6,6 +6,7 @@
 #include "mail-index-modseq.h"
 #include "mail-search-build.h"
 #include "mailbox-list-private.h"
+#include "index-pop3-uidl.h"
 #include "dbox-mail.h"
 #include "dbox-save.h"
 #include "sdbox-file.h"
@@ -262,6 +263,9 @@ int sdbox_mailbox_create_indexes(struct mailbox *box,
                                                 update->min_highest_modseq);
        }
 
+       if (box->inbox_user)
+               index_pop3_uidl_set_max_uid(box, trans, 0);
+
        sdbox_update_header(mbox, trans, update);
        if (new_trans != NULL) {
                if (mail_index_transaction_commit(&new_trans) < 0) {