]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir: Don't try to preserve old filename when saving if uidlist couldn't be locked.
authorTimo Sirainen <tss@iki.fi>
Sun, 17 Feb 2013 08:11:20 +0000 (10:11 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 17 Feb 2013 08:11:20 +0000 (10:11 +0200)
src/lib-storage/index/maildir/maildir-save.c

index 606272f2d699d9073e902073af41252d3bccf815..c5c9b2c1ad5865c0a0ca69c1bba485139112ea5e 100644 (file)
@@ -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.