]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission: EHLO command: Remove obsolete pending_ehlo handling.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 27 Dec 2017 13:38:41 +0000 (14:38 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 28 Dec 2017 18:43:39 +0000 (20:43 +0200)
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
src/submission/submission-client.h

index e1c4990ca2b24857aab02b323c48e5160e6ce14b..8de06f05ff628a669c9e666e35937908850c014f 100644 (file)
@@ -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);
-}
index d12b579f868918b994990a88de0f956d6574315a..455a4e95050db5791363fd717818f6b599cebbea 100644 (file)
@@ -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;