From 1ac6344d29e3920d0eda7c037265d217c81ff2df Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 7 Jul 2026 23:21:49 +0200 Subject: [PATCH] Enhance dovecot-logreport script: improve statistics output format and clarity --- dovecot-logreport.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dovecot-logreport.sh b/dovecot-logreport.sh index 9fa33c4..c12a8d8 100755 --- a/dovecot-logreport.sh +++ b/dovecot-logreport.sh @@ -599,10 +599,10 @@ BEGIN { if (emailneedle != "" && index(tolower(user), emailneedle) == 0) next total++ + c_res[res]++ # Stats sammeln if (stats == 1) { - c_res[res]++ c_type[type]++ c_res_type[res "@" type]++ @@ -642,7 +642,21 @@ BEGIN { END { progress_clear() - if (stats != 1) exit + if (stats != 1) { + if (oneline == 1) { + printf "stats\ttotal=%d\tsuccess=%d\tfail=%d\terror=%d\tinfo=%d\n", total+0, c_res["success"]+0, c_res["fail"]+0, c_res["error"]+0, c_res["info"]+0 + exit + } + + print "" + print "Statistics:" + printf " total: %7d\n", total+0 + printf " success: %7d\n", c_res["success"]+0 + printf " fail: %7d\n", c_res["fail"]+0 + printf " error: %7d\n", c_res["error"]+0 + printf " info: %7d\n", c_res["info"]+0 + exit + } print "Events: " total print ""