From: Stephan Bosch Date: Wed, 7 Mar 2018 14:14:52 +0000 (+0100) Subject: submission-login: Only send HELO domain to post-login service when it is valid. X-Git-Tag: 2.3.1~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f431eff6b9f4c3a2f99ef0bcbd91d3b6b38f721e;p=thirdparty%2Fdovecot%2Fcore.git submission-login: Only send HELO domain to post-login service when it is valid. --- diff --git a/src/submission-login/client-authenticate.c b/src/submission-login/client-authenticate.c index 6d062096a7..190fa73fa0 100644 --- a/src/submission-login/client-authenticate.c +++ b/src/submission-login/client-authenticate.c @@ -255,17 +255,19 @@ int cmd_auth(void *conn_ctx, struct smtp_server_cmd_ctx *cmd, struct submission_client *subm_client = conn_ctx; struct client *client = &subm_client->common; struct smtp_server_helo_data *helo; - char *prefix; + const char *prefix = ""; i_assert(subm_client->pending_auth == NULL); helo = smtp_server_connection_get_helo_data(subm_client->conn); - - prefix = i_strdup(helo->domain == NULL ? "" : helo->domain); + if (helo->domain_valid) { + i_assert(helo->domain != NULL); + prefix = helo->domain; + } /* pass ehlo parameter to post-login service upon successful login */ i_free(client->master_data_prefix); - client->master_data_prefix = (void *)prefix; + client->master_data_prefix = (void *)i_strdup(prefix); client->master_data_prefix_len = strlen(prefix) + 1; subm_client->pending_auth = cmd;