Logging: expand hosts_connection_nolog coverage
authorJeremy Harris <jgh146exb@wizmail.org>
Fri, 3 Jun 2022 15:58:12 +0000 (16:58 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Fri, 3 Jun 2022 15:58:12 +0000 (16:58 +0100)
doc/doc-docbook/spec.xfpt
doc/doc-txt/ChangeLog
src/src/exim.c

index 74f92f5a78891614c23cd3ce847bf95284cc0276..253ee42f9511d4dea11b1c380155c3f15cc345e0 100644 (file)
@@ -16387,7 +16387,10 @@ local processes, you must create a host list with an empty item. For example:
 .code
 hosts_connection_nolog = :
 .endd
 .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
 
 
 .option hosts_require_alpn main "host list&!!" unset
index ff35328a1643cc2daea9261a1b19879af785b387..2ab1af9d4a1b9a1a35110de2f86d7d3ec7a8f54c 100644 (file)
@@ -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.
 
 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
 -----------------
 
 Exim version 4.96
 -----------------
 
index 786d24e4fe30831eaaa66461e55f0f16762a1eaa..eac0cb2b986fcfd9fed22ed8925689330f489b02 100644 (file)
@@ -5429,7 +5429,10 @@ if (host_checking)
 
   memset(sender_host_cache, 0, sizeof(sender_host_cache));
   if (verify_check_host(&hosts_connection_nolog) == OK)
 
   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_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,
   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)
   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_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())
     {
   log_write(L_smtp_connection, LOG_MAIN, "%s", smtp_get_connection_info());
   if (!smtp_start_session())
     {