From: Timo Sirainen Date: Sun, 17 Feb 2013 08:11:20 +0000 (+0200) Subject: maildir: Don't try to preserve old filename when saving if uidlist couldn't be locked. X-Git-Tag: 2.2.beta2~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=20cf8d14fc3304c274121192c11fa8a36e40d8c8;p=thirdparty%2Fdovecot%2Fcore.git maildir: Don't try to preserve old filename when saving if uidlist couldn't be locked. --- diff --git a/src/lib-storage/index/maildir/maildir-save.c b/src/lib-storage/index/maildir/maildir-save.c index 606272f2d6..c5c9b2c1ad 100644 --- a/src/lib-storage/index/maildir/maildir-save.c +++ b/src/lib-storage/index/maildir/maildir-save.c @@ -818,12 +818,13 @@ maildir_filename_check_conflicts(struct maildir_save_context *ctx, { uoff_t size; - if (!ctx->locked_uidlist_refresh) { + if (!ctx->locked_uidlist_refresh && ctx->locked) { (void)maildir_uidlist_refresh(ctx->mbox->uidlist); ctx->locked_uidlist_refresh = TRUE; } - if ((prev_mf != NULL && maildir_filename_has_conflict(mf, prev_mf)) || + if (!ctx->locked_uidlist_refresh || + (prev_mf != NULL && maildir_filename_has_conflict(mf, prev_mf)) || maildir_uidlist_get_full_filename(ctx->mbox->uidlist, mf->dest_basename) != NULL) { /* file already exists. give it another name.