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 9721fb7d61c5123e4f43f6c910341c7b7e080e0e..d6250d12dc156257324194dda8b41533332ff721 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 a19051aa1a5c0c638543f1d1cfa69c34cbb82958..b395954a4eb2b7d9968bab0e2d0007433f4c6879 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 310a4ef29ece98dc313c31ff5457b332bba947df..b9e93a9109114d565856bb9b24f1077e33a626c2 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 be65144469738dd46f751b47d95ad0cdef35db8c..ea998d6d7ab6409c47ef65daa6e0e4ec0d339365 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 bc8aeca3006bc67f055f2b77fd5741c60e276e5e..51962ce6613068926dd6bbe4050d9ddb3508734c 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