From ae80738263712ae4f7dcf6a87a99320447537cfb Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Fri, 3 Jun 2022 16:58:12 +0100 Subject: [PATCH] Logging: expand hosts_connection_nolog coverage --- doc/doc-docbook/spec.xfpt | 5 ++++- doc/doc-txt/ChangeLog | 6 ++++++ src/src/exim.c | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 74f92f5a7..253ee42f9 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -16387,7 +16387,10 @@ local processes, you must create a host list with an empty item. For example: .code hosts_connection_nolog = : .endd -If the &%smtp_connection%& log selector is not set, this option has no effect. +.new +The hosts affected by this option also do not log "no MAIL in SMTP connection" +lines, as may commonly be produced by a monitoring system. +.wen .option hosts_require_alpn main "host list&!!" unset diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index ff35328a1..2ab1af9d4 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -2,6 +2,12 @@ This document describes *changes* to previous versions, that might affect Exim's operation, with an unchanged configuration file. For new options, and new features, see the NewStuff file next to this ChangeLog. +SINCE Exim version 4.96 +----------------- + +JH/01 The hosts_connection_nolog main option now also controls "no MAIL in + SMTP connection" log lines. + Exim version 4.96 ----------------- diff --git a/src/src/exim.c b/src/src/exim.c index 786d24e4f..eac0cb2b9 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -5429,7 +5429,10 @@ if (host_checking) memset(sender_host_cache, 0, sizeof(sender_host_cache)); if (verify_check_host(&hosts_connection_nolog) == OK) + { BIT_CLEAR(log_selector, log_selector_size, Li_smtp_connection); + BIT_CLEAR(log_selector, log_selector_size, Li_smtp_no_mail); + } log_write(L_smtp_connection, LOG_MAIN, "%s", smtp_get_connection_info()); /* NOTE: We do *not* call smtp_log_no_mail() if smtp_start_session() fails, @@ -5618,7 +5621,10 @@ if (smtp_input) smtp_out = stdout; memset(sender_host_cache, 0, sizeof(sender_host_cache)); if (verify_check_host(&hosts_connection_nolog) == OK) + { BIT_CLEAR(log_selector, log_selector_size, Li_smtp_connection); + BIT_CLEAR(log_selector, log_selector_size, Li_smtp_no_mail); + } log_write(L_smtp_connection, LOG_MAIN, "%s", smtp_get_connection_info()); if (!smtp_start_session()) { -- 2.30.2