From: Stephan Bosch Date: Wed, 7 Mar 2018 14:03:42 +0000 (+0100) Subject: lib-smtp: server: Fix application of pre-login HELO domain when no post-login HELO... X-Git-Tag: 2.3.1~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d70971de9c1fd17ab88c9a63b3fbef95040c341d;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: server: Fix application of pre-login HELO domain when no post-login HELO is issued. The substituted domain was not marked as valid, which caused the HELO field of the produced received line to be set to 'unknown'. --- diff --git a/src/lib-smtp/smtp-server-cmd-mail.c b/src/lib-smtp/smtp-server-cmd-mail.c index f1574bf6f1..abb9cee778 100644 --- a/src/lib-smtp/smtp-server-cmd-mail.c +++ b/src/lib-smtp/smtp-server-cmd-mail.c @@ -105,11 +105,13 @@ void smtp_server_cmd_mail(struct smtp_server_cmd_ctx *cmd, return; } - if (conn->pending_helo == NULL && conn->helo.domain == NULL) { + if (conn->pending_helo == NULL && conn->helo.domain == NULL && + conn->helo_login != NULL && *conn->helo_login != '\0') { /* no EHLO executed post-login, use pre-login value instead */ conn->helo_domain = conn->helo_login; - conn->helo_login = NULL; conn->helo.domain = conn->helo_domain; + conn->helo.domain_valid = TRUE; + conn->helo_login = NULL; } mail_data = p_new(cmd->pool, struct smtp_server_cmd_mail, 1);