Logging: add elapsed-time element to unexpected-diconnection lines
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 20 Aug 2017 12:42:16 +0000 (13:42 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 20 Aug 2017 12:42:16 +0000 (13:42 +0100)
src/src/smtp_in.c
test/log/0609
test/stderr/0004
test/stderr/0609
test/stderr/5840

index 9721fb7..d6250d1 100644 (file)
@@ -5460,14 +5460,17 @@ while (done <= 0)
     */
 
     if (sender_address != NULL || recipients_count > 0)
-      log_write(L_lost_incoming_connection,
-          LOG_MAIN,
-          "unexpected %s while reading SMTP command from %s%s",
-          sender_host_unknown? "EOF" : "disconnection",
-          host_and_ident(FALSE), smtp_read_error);
-
-    else log_write(L_smtp_connection, LOG_MAIN, "%s lost%s",
-      smtp_get_connection_info(), smtp_read_error);
+      log_write(L_lost_incoming_connection, LOG_MAIN,
+          "unexpected %s while reading SMTP command from %s%s D=%s",
+          sender_host_unknown ? "EOF" : "disconnection",
+          host_and_ident(FALSE), smtp_read_error,
+         string_timesince(&smtp_connection_start)
+         );
+
+    else
+      log_write(L_smtp_connection, LOG_MAIN, "%s lost%s D=%s",
+        smtp_get_connection_info(), smtp_read_error,
+       string_timesince(&smtp_connection_start));
 
     done = 1;
     break;
index a19051a..b395954 100644 (file)
@@ -4,4 +4,4 @@
 1999-03-02 09:44:33 SMTP connection from [127.0.0.1] (TCP/IP connection count = 1)
 1999-03-02 09:44:33 SMTP connection from [127.0.0.1] closed by QUIT
 1999-03-02 09:44:33 SMTP connection from [127.0.0.1] (TCP/IP connection count = 1)
-1999-03-02 09:44:33 unexpected disconnection while reading SMTP command from [127.0.0.1]
+1999-03-02 09:44:33 unexpected disconnection while reading SMTP command from [127.0.0.1] D=qqs
index 310a4ef..b9e93a9 100644 (file)
@@ -479,4 +479,4 @@ LOG: H=[1.1.1.1] F=<BY@aa.bb> rejected RCPT <x@test.ex>
 >>> deny: condition test succeeded in ACL "check_recipient"
 >>> end of ACL "check_recipient": DENY
 LOG: H=[1.1.1.1] F=<BlOcKeD@zz.xy> rejected RCPT <x@test.ex>
-LOG: unexpected disconnection while reading SMTP command from [1.1.1.1]
+LOG: unexpected disconnection while reading SMTP command from [1.1.1.1] D=qqs
index be65144..ea998d6 100644 (file)
@@ -45,7 +45,7 @@ ppppp delay cancelled by peer close
 ppppp accept: condition test succeeded in ACL "delay4_accept"
 ppppp end of ACL "delay4_accept": ACCEPT
 ppppp LOG: lost_incoming_connection MAIN
-ppppp   unexpected disconnection while reading SMTP command from [127.0.0.1]
+ppppp   unexpected disconnection while reading SMTP command from [127.0.0.1] D=qqs
 ppppp child ppppp ended: status=0x100
 ppppp   normal exit, 1
 ppppp 0 SMTP accept processes now running
index bc8aeca..51962ce 100644 (file)
@@ -65,7 +65,7 @@
 >>> ----------- end verify ------------
 >>> accept: condition test succeeded in inline ACL
 >>> end of inline ACL: ACCEPT
-LOG: unexpected disconnection while reading SMTP command from [127.0.0.1]
+LOG: unexpected disconnection while reading SMTP command from [127.0.0.1] D=qqs
 ### TLSA (2 0 1)
 ### A server with a nonverifying cert and no TLSA
 ### A server with a verifying cert and no TLSA