From ffd0514cb93e57ea104a080b762487bd2b0f4ddf Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Wed, 27 Dec 2017 14:36:10 +0100 Subject: [PATCH] submission: Block server input handling until proxy connection to relay server completes. This makes sure we are aware of the full extent of the backend server's capabilities, before we start handling commands. Before, only EHLO commands were blocked this way, but this did not account for MAIL/RCPT parameters, which are equally dependent. Fixes problems with clients that send no EHLO after AUTH, like Thunderbird. --- src/submission/submission-client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/submission/submission-client.c b/src/submission/submission-client.c index c614fa391e..5264799d84 100644 --- a/src/submission/submission-client.c +++ b/src/submission/submission-client.c @@ -96,8 +96,8 @@ static void client_proxy_ready_cb(const struct smtp_reply *reply, SMTP_CAPABILITY_VRFY; smtp_server_connection_set_capabilities(client->conn, caps); - /* send EHLO reply when EHLO command is pending */ - client_handshake(client); + /* now that we know our capabilities, commence server protocol dialog */ + smtp_server_connection_resume(client->conn); } static void client_proxy_create(struct client *client, @@ -215,7 +215,7 @@ struct client *client_create(int fd_in, int fd_out, smtp_server_connection_login(client->conn, client->user->username, helo, pdata, pdata_len, user->conn.ssl_secured); - smtp_server_connection_start(client->conn); + smtp_server_connection_start_pending(client->conn); mail_set = mail_user_set_get_storage_set(user); if (*set->imap_urlauth_host != '\0' &&