Debug old ehlo-resp record date, on noting mismatch
authorJeremy Harris <jgh146exb@wizmail.org>
Wed, 14 Jun 2023 11:33:21 +0000 (12:33 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 20 Jun 2023 20:14:28 +0000 (21:14 +0100)
src/src/transports/smtp.c

index 24ee577a2eb9bda331d21d78eff953d6f8032b38..926e77df4c8169a94d15baa1691a00350d43d8c7 100644 (file)
@@ -931,6 +931,16 @@ if (  sx->early_pipe_active
    && (dbm_file = dbfn_open(US"misc", O_RDWR, &dbblock, TRUE, TRUE)))
   {
   uschar * ehlo_resp_key = ehlo_cache_key(sx);
+  HDEBUG(D_transport)
+    {
+    dbdata_ehlo_resp * er;
+
+    if (!(er = dbfn_read_enforce_length(dbm_file, ehlo_resp_key, sizeof(dbdata_ehlo_resp))))
+      debug_printf("no ehlo-resp record!\n");
+    else
+      debug_printf("ehlo-resp record is %d seconds old\n", time(NULL) - er->time_stamp);
+    }
+
   dbfn_delete(dbm_file, ehlo_resp_key);
   dbfn_close(dbm_file);
   }