]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-login: proxy: Don't forward untagged BYE responses to the client
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 6 Oct 2021 12:43:09 +0000 (15:43 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 12 Oct 2021 06:17:00 +0000 (06:17 +0000)
It will just cause confusion, especially when connections are retried.
It could end up looking like:

x login user pass
* BYE Internal error occurred. Refer to server log for more information.
* BYE Internal error occurred. Refer to server log for more information.
* BYE Internal error occurred. Refer to server log for more information.
* BYE Internal error occurred. Refer to server log for more information.
x NO [UNAVAILABLE] Account is temporarily unavailable.

src/imap-login/imap-proxy.c

index e06996083a0b21e0f9931d72fe932fdadd3cb6c8..aa5a5aaf54db279f32a54e6410266c68dfd5df4a 100644 (file)
@@ -438,6 +438,13 @@ int imap_proxy_parse_line(struct client *client, const char *line)
        } else if (strncasecmp(line, "* ID ", 5) == 0) {
                /* Reply to ID command we sent, ignore it */
                return 0;
+       } else if (str_begins(line, "* BYE ")) {
+               /* Login unexpectedly failed (due to some internal error).
+                  Don't forward the BYE to the client, since we're not going
+                  to disconnect it. It could be a possibility to convert these
+                  to NO replies, but they're likely not going to provide
+                  anything useful. */
+               return 0;
        } else if (str_begins(line, "* ")) {
                /* untagged reply. just forward it. */
                client_send_raw(client, t_strconcat(line, "\r\n", NULL));