From a8825b8a679fbf819e6cb4410951e79071677bef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Tue, 12 Nov 2024 03:03:14 -0500
Subject: [PATCH] Add more paranoia.

This is a suitable amount of paranoia now.
---
 exec/imapservice.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/exec/imapservice.js b/exec/imapservice.js
index 3d3c50f15a..d5c09e8515 100644
--- a/exec/imapservice.js
+++ b/exec/imapservice.js
@@ -1409,11 +1409,16 @@ function open_cfg(usr)
 
 function lock_cfg()
 {
+	start = time();
 	while(!cfgfile.lock(0, 1)) {
 		if (!client.socket.is_connected)
 			exit(0);
 		if (js.termianted)
 			exit(0);
+		if ((time() - start) > 45) {
+			log(LOG_ERR, "Timed out waiting 45 seconds for IMAP log.");
+			exit(0);
+		}
 		mswait(10);
 	}
 }
-- 
GitLab