First, don't even attempt an APPEND if we've already seen an auth failure.
Second, if APPEND does fail because of auth error, set the correct error to
storage.
i_assert(ctx->fd == -1);
+ if (imapc_storage_client_handle_auth_failure(ctx->mbox->storage->client))
+ return -1;
+
ctx->fd = imapc_client_create_temp_fd(ctx->mbox->storage->client->client,
&path);
if (ctx->fd == -1) {
imapc_save_appenduid(ctx->ctx, reply, &uid);
imapc_save_add_to_index(ctx->ctx, uid);
ctx->ret = 0;
+ } else if (imapc_storage_client_handle_auth_failure(ctx->ctx->mbox->storage->client)) {
+ ctx->ret = -1;
} else if (reply->state == IMAPC_COMMAND_STATE_NO) {
imapc_copy_error_from_reply(ctx->ctx->mbox->storage,
MAIL_ERROR_PARAMS, reply);