From: Timo Sirainen Date: Wed, 13 Jul 2016 20:10:57 +0000 (-0500) Subject: dbox: Initialize pop3-uidl header on INBOX creation. X-Git-Tag: 2.3.0.rc1~3307 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a956137aa86d16e5a90b9d4a9e69d3854d824380;p=thirdparty%2Fdovecot%2Fcore.git dbox: Initialize pop3-uidl header on INBOX creation. 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. --- diff --git a/src/lib-storage/index/dbox-multi/mdbox-storage.c b/src/lib-storage/index/dbox-multi/mdbox-storage.c index a58bd736fb..f9a4614594 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-storage.c +++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c @@ -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) { diff --git a/src/lib-storage/index/dbox-single/sdbox-storage.c b/src/lib-storage/index/dbox-single/sdbox-storage.c index 333c4aca46..05b42a313d 100644 --- a/src/lib-storage/index/dbox-single/sdbox-storage.c +++ b/src/lib-storage/index/dbox-single/sdbox-storage.c @@ -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) {