dovecot-2.0: expire-tool --test: Log timestamps also in user-rea...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 1 02:50:17 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/1da29762c407
changeset: 9412:1da29762c407
user:      Timo Sirainen <tss at iki.fi>
date:      Sun May 31 19:48:46 2009 -0400
description:
expire-tool --test: Log timestamps also in user-readable format.

diffstat:

1 file changed, 7 insertions(+), 5 deletions(-)
src/plugins/expire/expire-tool.c |   12 +++++++-----

diffs (40 lines):

diff -r b5f9a3387b5a -r 1da29762c407 src/plugins/expire/expire-tool.c
--- a/src/plugins/expire/expire-tool.c	Sun May 31 19:29:53 2009 -0400
+++ b/src/plugins/expire/expire-tool.c	Sun May 31 19:48:46 2009 -0400
@@ -171,7 +171,7 @@ static void expire_run(struct master_ser
 	struct dict_transaction_context *trans;
 	struct dict_iterate_context *iter;
 	struct expire_env *env;
-	time_t oldest;
+	time_t oldest, expire_time;
 	unsigned int expunge_secs, altmove_secs;
 	const char *p, *key, *value, *expire, *expire_altmove, *expire_dict;
 	const char *userp = NULL, *mailbox;
@@ -229,12 +229,13 @@ static void expire_run(struct master_ser
 			}
 			continue;
 		}
-		if (time(NULL) < (time_t)strtoul(value, NULL, 10)) {
+		expire_time = strtoul(value, NULL, 10);
+		if (time(NULL) < expire_time) {
 			/* this and the rest of the timestamps are in future,
 			   so stop processing */
 			if (testrun) {
 				i_info("%s: stop, expire time in future: %s",
-				       userp, value);
+				       userp, ctime(&expire_time));
 			}
 			break;
 		}
@@ -268,8 +269,9 @@ static void expire_run(struct master_ser
 			} else if (!testrun)
 				dict_set(trans, key, new_value);
 			else {
-				i_info("%s: timestamp %s -> %s",
-				       userp, value, new_value);
+				i_info("%s: timestamp %s (%s) -> %s (%s)",
+				       userp, value, ctime(&expire_time),
+				       new_value, ctime(&oldest));
 			}
 		}
 	}


More information about the dovecot-cvs mailing list