]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-client: Remove stale empty resp-text error check
authorAki Tuomi <aki.tuomi@open-xchange.com>
Sat, 16 May 2026 20:20:02 +0000 (23:20 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 1 Jun 2026 05:54:20 +0000 (05:54 +0000)
imapc_connection_handle_imap_resp_text() rejected an empty text atom
with "Missing text in resp-text". RFC 9051 change note #23 explicitly
made text optional in resp-text, so this error is wrong.

The check was dead code in practice — the imap parser only enters
ARG_PARSE_TEXT mode after a resp-text-code ending in ']', so the text
argument at args[1] is never an empty atom — but leaving it in place
risks breaking connections if the parser behavior ever changes.

src/lib-imap-client/imapc-connection.c

index 7883a8ee75b14ae892e8d2d501d9015fbc30d2df..561531da43776dbffc58f33e1a67ac8f76abf102 100644 (file)
@@ -867,14 +867,8 @@ imapc_connection_handle_imap_resp_text(struct imapc_connection *conn,
                return 0;
 
        text = imap_args_to_str(args);
-       if (*text != '[') {
-               if (*text == '\0') {
-                       imapc_connection_input_error(conn,
-                               "Missing text in resp-text");
-                       return -1;
-               }
+       if (*text != '[')
                return 0;
-       }
        return imapc_connection_handle_resp_text(conn, text, key_r, value_r);
 }