Skip to content

Commit

Permalink
dbox: Initialize pop3-uidl header on INBOX creation.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen committed Jul 13, 2016
1 parent 9342a5f commit a956137
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib-storage/index/dbox-multi/mdbox-storage.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions src/lib-storage/index/dbox-single/sdbox-storage.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a956137

Please sign in to comment.