Add comments as to why smtp_log_no_mail() is not called when
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Wed, 17 Jan 2007 11:29:39 +0000 (11:29 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Wed, 17 Jan 2007 11:29:39 +0000 (11:29 +0000)
smtp_start_session() fails - and arrange not to do so in the -bh case.

src/src/daemon.c
src/src/exim.c

index 81c32020e7ba4debe136c730e45deb38503e31f9..1e639453cd1fc51fe39c520ee37fdf292d9da776 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/daemon.c,v 1.20 2007/01/15 15:59:22 ph10 Exp $ */
+/* $Cambridge: exim/src/src/daemon.c,v 1.21 2007/01/17 11:29:39 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -468,7 +468,12 @@ if (pid == 0)
   /* Handle the start of the SMTP session, then loop, accepting incoming
   messages from the SMTP connection. The end will come at the QUIT command,
   when smtp_setup_msg() returns 0. A break in the connection causes the
   /* Handle the start of the SMTP session, then loop, accepting incoming
   messages from the SMTP connection. The end will come at the QUIT command,
   when smtp_setup_msg() returns 0. A break in the connection causes the
-  process to die (see accept.c). */
+  process to die (see accept.c).
+
+  NOTE: We do *not* call smtp_log_no_mail() if smtp_start_session() fails,
+  because a log line has already been written for all its failure exists
+  (usually "connection refused: <reason>") and writing another one is
+  unnecessary clutter. */
 
   if (!smtp_start_session())
     {
 
   if (!smtp_start_session())
     {
index d33a04d03325fca0f0a6870300c3f42643f4cff9..553f47d997457d71fcc80ade90a18cb4ba78ca37 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/exim.c,v 1.52 2007/01/15 15:59:22 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim.c,v 1.53 2007/01/17 11:29:39 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -4371,6 +4371,11 @@ if (host_checking)
     log_write_selector &= ~L_smtp_connection;
   log_write(L_smtp_connection, LOG_MAIN, "%s", smtp_get_connection_info());
 
     log_write_selector &= ~L_smtp_connection;
   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,
+  because a log line has already been written for all its failure exists
+  (usually "connection refused: <reason>") and writing another one is
+  unnecessary clutter. */
+
   if (smtp_start_session())
     {
     reset_point = store_get(0);
   if (smtp_start_session())
     {
     reset_point = store_get(0);
@@ -4380,8 +4385,8 @@ if (host_checking)
       if (smtp_setup_msg() <= 0) break;
       if (!receive_msg(FALSE)) break;
       }
       if (smtp_setup_msg() <= 0) break;
       if (!receive_msg(FALSE)) break;
       }
+    smtp_log_no_mail();
     }
     }
-  smtp_log_no_mail();
   exim_exit(EXIT_SUCCESS);
   }
 
   exim_exit(EXIT_SUCCESS);
   }
 
@@ -4519,7 +4524,12 @@ if ((!smtp_input || smtp_batched_input) && !receive_check_fs(0))
   }
 
 /* If this is smtp input of any kind, handle the start of the SMTP
   }
 
 /* If this is smtp input of any kind, handle the start of the SMTP
-session. */
+session.
+
+NOTE: We do *not* call smtp_log_no_mail() if smtp_start_session() fails,
+because a log line has already been written for all its failure exists
+(usually "connection refused: <reason>") and writing another one is
+unnecessary clutter. */
 
 if (smtp_input)
   {
 
 if (smtp_input)
   {