From: Philip Hazel Date: Wed, 17 Jan 2007 11:29:39 +0000 (+0000) Subject: Add comments as to why smtp_log_no_mail() is not called when X-Git-Tag: exim-4_67~72 X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/24796b8d20edd438ff520630d4cf4a39d94dcada?hp=431b736177e2cdfd0b4da4c8545d8b732286abe1 Add comments as to why smtp_log_no_mail() is not called when smtp_start_session() fails - and arrange not to do so in the -bh case. --- diff --git a/src/src/daemon.c b/src/src/daemon.c index 81c32020e..1e639453c 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -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 * @@ -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 - 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: ") and writing another one is + unnecessary clutter. */ if (!smtp_start_session()) { diff --git a/src/src/exim.c b/src/src/exim.c index d33a04d03..553f47d99 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -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 * @@ -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()); + /* 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: ") and writing another one is + unnecessary clutter. */ + 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; } + smtp_log_no_mail(); } - smtp_log_no_mail(); 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 -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: ") and writing another one is +unnecessary clutter. */ if (smtp_input) {