git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add comments as to why smtp_log_no_mail() is not called when
[exim.git]
/
src
/
src
/
exim.c
diff --git
a/src/src/exim.c
b/src/src/exim.c
index 6f53c1ffbf433f2ecefe849ae5958d5ccdf14299..553f47d997457d71fcc80ade90a18cb4ba78ca37 100644
(file)
--- a/
src/src/exim.c
+++ b/
src/src/exim.c
@@
-1,10
+1,10
@@
-/* $Cambridge: exim/src/src/exim.c,v 1.
49 2006/11/13 11:56:41
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 *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 200
6
*/
+/* Copyright (c) University of Cambridge 1995 - 200
7
*/
/* See the file NOTICE for conditions of use and distribution. */
/* See the file NOTICE for conditions of use and distribution. */
@@
-1498,7
+1498,8
@@
regex_ismsgid =
regex_must_compile(US"^(?:[^\\W_]{6}-){2}[^\\W_]{2}$", FALSE, TRUE);
/* Precompile the regular expression that is used for matching an SMTP error
regex_must_compile(US"^(?:[^\\W_]{6}-){2}[^\\W_]{2}$", FALSE, TRUE);
/* Precompile the regular expression that is used for matching an SMTP error
-code, possibly extended, at the start of an error message. */
+code, possibly extended, at the start of an error message. Note that the
+terminating whitespace character is included. */
regex_smtp_code =
regex_must_compile(US"^\\d\\d\\d\\s(?:\\d\\.\\d\\d?\\d?\\.\\d\\d?\\d?\\s)?",
regex_smtp_code =
regex_must_compile(US"^\\d\\d\\d\\s(?:\\d\\.\\d\\d?\\d?\\.\\d\\d?\\d?\\s)?",
@@
-4370,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);
@@
-4379,6
+4385,7
@@
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();
}
exim_exit(EXIT_SUCCESS);
}
}
exim_exit(EXIT_SUCCESS);
}
@@
-4517,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)
{
@@
-4635,10
+4647,15
@@
while (more)
if (message_id[0] == 0)
{
if (more) continue;
if (message_id[0] == 0)
{
if (more) continue;
+ smtp_log_no_mail(); /* Log no mail if configured */
exim_exit(EXIT_FAILURE);
}
}
exim_exit(EXIT_FAILURE);
}
}
- else exim_exit((rc == 0)? EXIT_SUCCESS : EXIT_FAILURE);
+ else
+ {
+ smtp_log_no_mail(); /* Log no mail if configured */
+ exim_exit((rc == 0)? EXIT_SUCCESS : EXIT_FAILURE);
+ }
}
/* In the non-SMTP case, we have all the information from the command
}
/* In the non-SMTP case, we have all the information from the command