]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: smtp-server-connection - Allow username/ehlo to be set before smtp_server_c...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 18 Jun 2021 14:52:26 +0000 (16:52 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 23 Jul 2021 06:47:02 +0000 (06:47 +0000)
This allows setting the proxy data early.

src/lib-smtp/smtp-server-connection.c

index 4d523b8f833c5073418e2d6191e5c5df551d8ca5..c3ee939c39cf7d9674ff9461756d67086166377e 100644 (file)
@@ -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;