diff -urN ../exim-4.94.2.orig/src/smtp_in.c ./src/smtp_in.c --- ../exim-4.94.2.orig/src/smtp_in.c 2021-04-30 15:08:21.000000000 +0300 +++ ./src/smtp_in.c 2021-11-20 00:24:15.349712000 +0200 @@ -3006,7 +3006,21 @@ if (tls_server_start(tls_require_ciphers, &user_msg) != OK) return smtp_log_tls_fail(user_msg); cmd_list[CMD_LIST_TLS_AUTH].is_mail_cmd = TRUE; + +if (raw_active_hostname != NULL) + { + uschar *nah = expand_string(raw_active_hostname); + if (nah == NULL) + { + if (!f.expand_string_forcedfail) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to expand \"%s\" " + "(smtp_active_hostname): %s", raw_active_hostname, + expand_string_message); } + else if (nah[0] != 0) smtp_active_hostname = nah; + } + + } #endif /* Run the connect ACL if it exists */ @@ -5584,6 +5598,20 @@ s = NULL; if ((rc = tls_server_start(tls_require_ciphers, &s)) == OK) { + +if (raw_active_hostname != NULL) + { + uschar *nah = expand_string(raw_active_hostname); + if (nah == NULL) + { + if (!f.expand_string_forcedfail) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to expand \"%s\" " + "(smtp_active_hostname): %s", raw_active_hostname, + expand_string_message); + } + else if (nah[0] != 0) smtp_active_hostname = nah; + } + if (!tls_remember_esmtp) fl.helo_seen = fl.esmtp = fl.auth_advertised = f.smtp_in_pipelining_advertised = FALSE; cmd_list[CMD_LIST_EHLO].is_mail_cmd = TRUE;