dovecot-2.2-pigeonhole: doveadm-sieve plugin: Improved debugging...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Sun Oct 19 16:14:33 UTC 2014


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/aad132a56c88
changeset: 1934:aad132a56c88
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Sun Oct 19 18:14:20 2014 +0200
description:
doveadm-sieve plugin: Improved debugging a bit.

diffstat:

 src/plugins/doveadm-sieve/doveadm-sieve-plugin.c |  21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 1040bbe3b924 -r aad132a56c88 src/plugins/doveadm-sieve/doveadm-sieve-plugin.c
--- a/src/plugins/doveadm-sieve/doveadm-sieve-plugin.c	Sun Oct 19 13:39:37 2014 +0200
+++ b/src/plugins/doveadm-sieve/doveadm-sieve-plugin.c	Sun Oct 19 18:14:20 2014 +0200
@@ -4,6 +4,7 @@
 #include "lib.h"
 #include "str.h"
 #include "ioloop.h"
+#include "time-util.h"
 #include "istream.h"
 #include "istream-concat.h"
 #include "mail-storage-private.h"
@@ -360,16 +361,30 @@
 {
 	struct mail_user *user = t->box->storage->user;
 	union mailbox_module_context *sbox = SIEVE_MAIL_CONTEXT(t->box);
-	time_t ts = value->last_change != 0 ? value->last_change : ioloop_time;
 
 	if (t->box->storage->user->dsyncing &&
 	    type == MAIL_ATTRIBUTE_TYPE_PRIVATE &&
 	    strncmp(key, MAILBOX_ATTRIBUTE_PREFIX_SIEVE,
 		    strlen(MAILBOX_ATTRIBUTE_PREFIX_SIEVE)) == 0) {
+		time_t ts =
+			(value->last_change != 0 ? value->last_change : ioloop_time);
+
 		if (sieve_attribute_set_sieve(t->box->storage, key, value) < 0)
 			return -1;
-		if (user->mail_debug)
-			i_debug("doveadm-sieve: Assigned value for key `%s'", key);
+
+		if (user->mail_debug) {
+			const char *change;
+			if (value->last_change != 0) {
+				change = t_strflocaltime
+					("(last change: %Y-%m-%d %H:%M:%S)", value->last_change);
+			} else {
+				change = t_strflocaltime
+					("(time: %Y-%m-%d %H:%M:%S)", ioloop_time);
+			}
+			i_debug("doveadm-sieve: Assigned value for key `%s' %s",
+				key, change);
+		}
+
 		/* FIXME: set value len to sieve script size / active name
 		   length */
 		if (value->value != NULL || value->value_stream != NULL)


More information about the dovecot-cvs mailing list