dovecot-1.1: expire-tool: More logging improvements.

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 5 17:11:49 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/fd204f7f7b29
changeset: 7915:fd204f7f7b29
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 05 17:07:59 2008 +0300
description:
expire-tool: More logging improvements.

diffstat:

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

diffs (61 lines):

diff -r 07e03a248555 -r fd204f7f7b29 src/plugins/expire/expire-tool.c
--- a/src/plugins/expire/expire-tool.c	Sun Oct 05 16:59:43 2008 +0300
+++ b/src/plugins/expire/expire-tool.c	Sun Oct 05 17:07:59 2008 +0300
@@ -66,7 +66,7 @@ mailbox_delete_old_mails(struct expire_c
 	struct mailbox_transaction_context *t;
 	struct mail_search_arg search_arg;
 	struct mail *mail;
-	const char *ns_mailbox;
+	const char *ns_mailbox, *errstr;
 	time_t now, save_time;
 	enum mail_error error;
 	enum mail_flags flags;
@@ -100,9 +100,12 @@ mailbox_delete_old_mails(struct expire_c
 
 	box = mailbox_open(ns->storage, ns_mailbox, NULL, 0);
 	if (box == NULL) {
-		(void)mail_storage_get_last_error(ns->storage, &error);
-		if (error != MAIL_ERROR_NOTFOUND)
+		errstr = mail_storage_get_last_error(ns->storage, &error);
+		if (error != MAIL_ERROR_NOTFOUND) {
+			i_error("%s: Opening mailbox %s failed: %s",
+				user, ns_mailbox, errstr);
 			return -1;
+		}
 		
 		/* mailbox no longer exists, remove the entry */
 		return 0;
@@ -117,9 +120,9 @@ mailbox_delete_old_mails(struct expire_c
 		if (mail_get_save_date(mail, &save_time) < 0) {
 			/* maybe just got expunged. anyway try again later. */
 			if (ctx->testrun) {
-				i_info("%s: seq=%u uid=%u: "
+				i_info("%s/%s: seq=%u uid=%u: "
 				       "Save date lookup failed",
-				       mailbox, mail->seq, mail->uid);
+				       user, mailbox, mail->seq, mail->uid);
 			}
 			ret = -1;
 			break;
@@ -130,8 +133,8 @@ mailbox_delete_old_mails(struct expire_c
 			if (!ctx->testrun)
 				mail_expunge(mail);
 			else {
-				i_info("%s: seq=%u uid=%u: Expunge",
-				       mailbox, mail->seq, mail->uid);
+				i_info("%s/%s: seq=%u uid=%u: Expunge",
+				       user, mailbox, mail->seq, mail->uid);
 			}
 		} else if (save_time + (time_t)altmove_secs <= now &&
 			   altmove_secs != 0) {
@@ -143,8 +146,8 @@ mailbox_delete_old_mails(struct expire_c
 				mail_update_flags(mail, MODIFY_ADD,
 						  MAIL_INDEX_MAIL_FLAG_BACKEND);
 			} else {
-				i_info("%s: seq=%u uid=%u: Move to alt dir",
-				       mailbox, mail->seq, mail->uid);
+				i_info("%s/%s: seq=%u uid=%u: Move to alt dir",
+				       user, mailbox, mail->seq, mail->uid);
 			}
 		} else {
 			/* first non-expired one. */


More information about the dovecot-cvs mailing list