Skip to content

Commit

Permalink
dbox: mailbox_update() shouldn't reset pop3-uidl header.
Browse files Browse the repository at this point in the history
This broke reading migrated POP3 UIDLs.
  • Loading branch information
sirainen committed Sep 22, 2016
1 parent 566c9a2 commit 051db9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/lib-storage/index/dbox-multi/mdbox-storage.c
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion src/lib-storage/index/dbox-single/sdbox-storage.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 051db9c

Please sign in to comment.