From cf7a2445b063a533788e336d463425907103788b Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Fri, 9 Jan 2009 03:31:40 +0000
Subject: [PATCH] Log warnings as well as errors. Check for errors/warnings
 after the second DoCommand() call as well

---
 exec/spamc.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/exec/spamc.js b/exec/spamc.js
index 6de75a0ebd..4d2e0d1a25 100644
--- a/exec/spamc.js
+++ b/exec/spamc.js
@@ -52,10 +52,20 @@ function main()
 		log(LOG_ERR,"spamc: !ERROR "+ret.error);
 		return;
 	}
+	if(ret.warning != undefined)
+		log(LOG_WARNING, "spamc: WARNING "+ret.warning);
+
 	if(!isNaN(ret.score)) {
 		log(LOG_INFO, "spamc: Score: " + ret.score + ' / ' + ret.threshold);
-		if(threshold && ret.score < threshold)
+		if(threshold && ret.score < threshold) {
 			var ret=msg.DoCommand(cmd='PROCESS');
+			if(ret.error != undefined) {
+				log(LOG_ERR,"spamc: !ERROR "+ret.error);
+				return;
+			}
+			if(ret.warning != undefined)
+				log(LOG_WARNING, "spamc: WARNING "+ret.warning);
+		}
 	}
 	if(cmd == 'PROCESS') {
 		var msg_file = new File(message_text_filename);
-- 
GitLab