From: Stephan Bosch Date: Fri, 18 Jun 2021 14:52:26 +0000 (+0200) Subject: lib-smtp: smtp-server-connection - Allow username/ehlo to be set before smtp_server_c... X-Git-Tag: 2.3.17~288 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=26b64133b2e8555c47bfdff254ece139f4a26d6a;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: smtp-server-connection - Allow username/ehlo to be set before smtp_server_connection_login(). This allows setting the proxy data early. --- diff --git a/src/lib-smtp/smtp-server-connection.c b/src/lib-smtp/smtp-server-connection.c index 4d523b8f83..c3ee939c39 100644 --- a/src/lib-smtp/smtp-server-connection.c +++ b/src/lib-smtp/smtp-server-connection.c @@ -1205,12 +1205,12 @@ void smtp_server_connection_login(struct smtp_server_connection *conn, unsigned int pdata_len, bool ssl_secured) { i_assert(!conn->started); - i_assert(conn->username == NULL); - i_assert(conn->helo_domain == NULL); conn->set.capabilities &= ENUM_NEGATE(SMTP_CAPABILITY_STARTTLS); + i_free(conn->username); conn->username = i_strdup(username); if (helo != NULL && *helo != '\0') { + i_free(conn->helo_domain); conn->helo_domain = i_strdup(helo); conn->helo.domain = conn->helo_domain; conn->helo.domain_valid = TRUE;