void mail_index_fsck_locked(struct mail_index *index);
 
+/* Log an error and set it as the index's current error that is available
+   with mail_index_get_error_message(). */
 void mail_index_set_error(struct mail_index *index, const char *fmt, ...)
        ATTR_FORMAT(2, 3);
+/* Same as mail_index_set_error(), but don't log the error. */
+void mail_index_set_error_nolog(struct mail_index *index, const char *str);
 /* "%s failed with index file %s: %m" */
 void mail_index_set_syscall_error(struct mail_index *index,
                                  const char *function);
 
        }
 }
 
+void mail_index_set_error_nolog(struct mail_index *index, const char *str)
+{
+       i_assert(str != NULL);
+
+       char *old_error = index->error;
+       index->error = i_strdup(str);
+       i_free(old_error);
+}
+
 bool mail_index_is_in_memory(struct mail_index *index)
 {
        return MAIL_INDEX_IS_IN_MEMORY(index);