]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Handle SEARCH NO replies by forwarding the error
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 3 Dec 2025 00:31:51 +0000 (02:31 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 3 Dec 2025 20:02:34 +0000 (22:02 +0200)
This is how most of the other commands already work. It just wasn't done
for SEARCH.

src/lib-storage/index/imapc/imapc-search.c

index 22b279c248499f21c2735fad1a2ef81dbc51dbf4..fc52a6035ec5f5f134979bf359f6762e055e5fd2 100644 (file)
@@ -202,6 +202,9 @@ static void imapc_search_callback(const struct imapc_command_reply *reply,
        if (reply->state == IMAPC_COMMAND_STATE_OK) {
                seq_range_array_iter_init(&ictx->iter, &ictx->rseqs);
                ictx->success = TRUE;
+       } else if (reply->state == IMAPC_COMMAND_STATE_NO) {
+               imapc_copy_error_from_reply(mbox->storage, MAIL_ERROR_PARAMS,
+                                           reply);
        } else if (reply->state == IMAPC_COMMAND_STATE_DISCONNECTED) {
                mail_storage_set_internal_error(mbox->box.storage);
        } else {