diff --git a/src/lib-storage/index/dbox-multi/mdbox-storage.c b/src/lib-storage/index/dbox-multi/mdbox-storage.c index 95585d0659..91e6fa3ce8 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-storage.c +++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c @@ -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) { diff --git a/src/lib-storage/index/dbox-single/sdbox-storage.c b/src/lib-storage/index/dbox-single/sdbox-storage.c index 05b42a313d..2dac9a81e9 100644 --- a/src/lib-storage/index/dbox-single/sdbox-storage.c +++ b/src/lib-storage/index/dbox-single/sdbox-storage.c @@ -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) {