bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2007-2018 Dovecot authors, see the included COPYING file */
3f91e60401495a4046c73992fabaa5e77200a451Timo Sirainen sync_flags = index_storage_get_sync_flags(&mbox->box) |
22ed97ce474ef40616a873d7356fd54faa8fec29Timo Sirainen if (mail_index_view_get_messages_count(mbox->box.view) > 0) {
22ed97ce474ef40616a873d7356fd54faa8fec29Timo Sirainen /* already-synced index was opened via
22ed97ce474ef40616a873d7356fd54faa8fec29Timo Sirainen mail-index-alloc-cache. */
d22301419109ed4a38351715e6760011421dadecTimo Sirainen ret = mail_index_sync_begin(mbox->box.index, &index_sync_ctx,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen /* set our uidvalidity */
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen offsetof(struct mail_index_header, uid_validity),
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen /* add our one and only message */
323c4e6d0c66310ea127184c9ecc60ad5e1f92b6Timo Sirainen while (mail_index_sync_next(index_sync_ctx, &sync_rec)) ;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen if (mail_index_sync_commit(&index_sync_ctx) < 0) {
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenraw_storage_sync_init(struct mailbox *box, enum mailbox_sync_flags flags)
8af1a286fb27446eeb0e7a8764cd3ed8d35ff2acJosef 'Jeff' Sipek struct raw_mailbox *mbox = RAW_MAILBOX(box);