changeset 8352:1dc1f8163166 HEAD

Quota: If mail_debug=yes, log when quota warning script is executed.
author Timo Sirainen <tss@iki.fi>
date Wed, 29 Oct 2008 18:41:56 +0200
parents cd83c5dc66d8
children 9873654f9c48
files src/plugins/quota/quota.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/quota/quota.c	Wed Oct 29 18:23:31 2008 +0200
+++ b/src/plugins/quota/quota.c	Wed Oct 29 18:41:56 2008 +0200
@@ -773,10 +773,14 @@
 	return 0;
 }
 
-static void quota_warning_execute(const char *cmd)
+static void quota_warning_execute(struct quota_root *root, const char *cmd)
 {
-	int ret = system(cmd);
+	int ret;
 
+	if (root->quota->set->debug)
+		i_info("quota: Executing warning: %s", cmd);
+
+	ret = system(cmd);
 	if (ret < 0) {
 		i_error("system(%s) failed: %m", cmd);
 	} else if (WIFSIGNALED(ret)) {
@@ -813,7 +817,7 @@
 		     bytes_current >= (uint64_t)warnings[i].rule.bytes_limit) ||
 		    (count_before < (uint64_t)warnings[i].rule.count_limit &&
 		     count_current >= (uint64_t)warnings[i].rule.count_limit)) {
-			quota_warning_execute(warnings[i].command);
+			quota_warning_execute(root, warnings[i].command);
 			break;
 		}
 	}