From d5ed3c4f0815f67f27e4bf5a8b03f39e82e90bec Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Wed, 27 Dec 2017 14:38:41 +0100 Subject: [PATCH] submission: EHLO command: Remove obsolete pending_ehlo handling. This was used to wait with sending an EHLO reply until the proxy connection to the relay server completes. The previous commit made this functionality obsolete, since command input handling is blocked entirely until the proxy connection is ready. --- src/submission/cmd-helo.c | 30 ------------------------------ src/submission/submission-client.h | 1 - 2 files changed, 31 deletions(-) diff --git a/src/submission/cmd-helo.c b/src/submission/cmd-helo.c index ac0a8ae1a3..dd8f32c5f3 100644 --- a/src/submission/cmd-helo.c +++ b/src/submission/cmd-helo.c @@ -115,8 +115,6 @@ static void cmd_helo_proxy_cb(const struct smtp_reply *proxy_reply, struct client *client = cmd_helo->client; struct smtp_reply reply; - client->pending_helo = NULL; - if (!client_command_handle_proxy_reply(client, proxy_reply, &reply)) return; @@ -156,22 +154,6 @@ int cmd_helo(void *conn_ctx, struct smtp_server_cmd_ctx *cmd, helo->data = data; cmd->context = helo; - if (!client_proxy_is_ready(client)) { - if (client_proxy_is_disconnected(client)) { - /* proxy connection died already */ - client_destroy(client, - t_strdup_printf("421 %s", client->set->hostname), - "Lost connection to relay server"); - return -1; - } - - if (client->pending_helo == NULL) - client->pending_helo = cmd; - - /* wait for proxy to become ready */ - return 0; - } - if (!data->first || smtp_server_connection_get_state(client->conn) >= SMTP_SERVER_STATE_READY) { /* this is not the first HELO/EHLO; just proxy a RSET command */ @@ -186,15 +168,3 @@ int cmd_helo(void *conn_ctx, struct smtp_server_cmd_ctx *cmd, return 1; } -void client_handshake(struct client *client) -{ - struct smtp_server_cmd_ctx *cmd; - - if (client->pending_helo == NULL) - return; - cmd = client->pending_helo; - client->pending_helo = NULL; - - /* continue EHLO/HELO response */ - cmd_helo_reply(cmd); -} diff --git a/src/submission/submission-client.h b/src/submission/submission-client.h index d12b579f86..455a4e9505 100644 --- a/src/submission/submission-client.h +++ b/src/submission/submission-client.h @@ -23,7 +23,6 @@ struct client { struct smtp_server_connection *conn; enum smtp_server_state last_state; struct client_state state; - struct smtp_server_cmd_ctx *pending_helo; struct mail_storage_service_user *service_user; struct mail_user *user;