From: Stephan Bosch Date: Wed, 27 Dec 2017 13:36:10 +0000 (+0100) Subject: submission: Block server input handling until proxy connection to relay server completes. X-Git-Tag: 2.3.9~2569 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d63fbcb367b6de01f5e39d72a825f03a832e308f;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/submission/submission-client.c b/src/submission/submission-client.c index b7c2dfb27a..26f022d1fc 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, @@ -208,7 +208,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' &&