Skip to content

Commit

Permalink
submission: EHLO command: Remove obsolete pending_ehlo handling.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stephanbosch authored and villesavolainen committed Feb 9, 2018
1 parent ffd0514 commit d5ed3c4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
30 changes: 0 additions & 30 deletions src/submission/cmd-helo.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Expand All @@ -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);
}
1 change: 0 additions & 1 deletion src/submission/submission-client.h
Expand Up @@ -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;
Expand Down

0 comments on commit d5ed3c4

Please sign in to comment.