]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-login: Add comments to internal ID command parameter handling
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 2 Feb 2026 09:44:58 +0000 (11:44 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 6 Feb 2026 07:58:43 +0000 (07:58 +0000)
src/imap-login/imap-login-cmd-id.c

index 1cd30bd1bc4cb64b45383c34fb2e733f9320a51a..e51e9c1e72754e07db8dd6d7fcabc0bc263db8c1 100644 (file)
@@ -183,8 +183,13 @@ static bool cmd_id_handle_keyvalue(struct imap_client *client,
                imap_id_param_handler_find(key);
        bool is_login_id_param = handler != NULL;
 
-       if (is_login_id_param && client->common.connection_trusted &&
-           !client->id_logged && value != NULL) {
+       if (!is_login_id_param) {
+               /* not an internal key */
+       } else if (client->id_logged) {
+               /* using ID multiple times - ignore */
+       } else if (value == NULL) {
+               /* there should have been a value - ignore */
+       } else if (client->common.connection_trusted) {
                if (!handler->callback(client->cmd_id->params, key, value)) {
                        e_debug(client->common.event,
                                "Client sent invalid ID parameter '%s'", key);