From: Timo Sirainen Date: Wed, 6 Oct 2021 12:38:55 +0000 (+0300) Subject: imap: Fix handling client initialization error X-Git-Tag: 2.3.18~202 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1e12cf4be00fc0678cf4d8eb567aa40c8864b988;p=thirdparty%2Fdovecot%2Fcore.git imap: Fix handling client initialization error It should send "OK Logged in" + BYE, not PREAUTH. Broken by 714ff4342e39e309ff184905cd2f714def6177a3 --- diff --git a/src/imap/main.c b/src/imap/main.c index 7e5d432808..8efcfd48ab 100644 --- a/src/imap/main.c +++ b/src/imap/main.c @@ -375,12 +375,15 @@ login_client_connected(const struct master_login_client *login_client, if ((flags & MAIL_AUTH_REQUEST_FLAG_CONN_SSL_SECURED) != 0) input.conn_ssl_secured = TRUE; + client_parse_imap_login_request(login_client->data, + login_client->auth_req.data_size, + &request); + if (client_create_from_input(&input, login_client->fd, login_client->fd, &client, &error) < 0) { int fd = login_client->fd; struct ostream *output = o_stream_create_fd_autoclose(&fd, IO_BLOCK_SIZE); - i_zero(&request); client_send_login_reply(output, NULL, NULL, &request); o_stream_destroy(&output); @@ -390,9 +393,6 @@ login_client_connected(const struct master_login_client *login_client, } if ((flags & MAIL_AUTH_REQUEST_FLAG_TLS_COMPRESSION) != 0) client->tls_compression = TRUE; - client_parse_imap_login_request(login_client->data, - login_client->auth_req.data_size, - &request); if (request.input_size > 0) { client_add_istream_prefix(client, request.input, request.input_size);