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

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


details:   http://hg.dovecot.org/dovecot-1.2/rev/f144ef760714
changeset: 9100:f144ef760714
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 e77a5e5ffc9d -r f144ef760714 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
@@ -224,7 +224,7 @@ static void expire_run(bool testrun)
 	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 *auth_socket, *p, *key, *value;
 	const char *userp, *mailbox;
@@ -286,12 +286,13 @@ static void expire_run(bool testrun)
 			}
 			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;
 		}
@@ -325,8 +326,9 @@ static void expire_run(bool testrun)
 			} 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