dovecot-2.0: expire plugin: If mail_debug=yes, log more debug in...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 8 06:53:25 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/3788f3b0f9b2
changeset: 9587:3788f3b0f9b2
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jul 07 23:37:22 2009 -0400
description:
expire plugin: If mail_debug=yes, log more debug information.

diffstat:

1 file changed, 23 insertions(+), 10 deletions(-)
src/plugins/expire/expire-plugin.c |   33 +++++++++++++++++++++++----------

diffs (47 lines):

diff -r aa6f96938626 -r 3788f3b0f9b2 src/plugins/expire/expire-plugin.c
--- a/src/plugins/expire/expire-plugin.c	Tue Jul 07 23:33:19 2009 -0400
+++ b/src/plugins/expire/expire-plugin.c	Tue Jul 07 23:37:22 2009 -0400
@@ -258,20 +258,33 @@ mailbox_expire_hook(struct mailbox *box,
 	MODULE_CONTEXT_SET(box, expire_storage_module, xpr_box);
 }
 
+static void expire_mailbox_allocate_init(struct mailbox *box,
+					 struct expire_mail_user *euser)
+{
+	unsigned int secs;
+	bool altmove;
+
+	secs = expire_box_find_min_secs(euser->env, box->vname, &altmove);
+	if (box->storage->user->mail_debug) {
+		if (secs == 0) {
+			i_info("expire: No expiring in mailbox: %s",
+			       box->vname);
+		} else {
+			i_info("expire: Mails expire in %u secs in mailbox: %s",
+			       secs, box->vname);
+		}
+	}
+	if (secs != 0)
+		mailbox_expire_hook(box, secs, altmove);
+}
+
 static void expire_mailbox_allocated(struct mailbox *box)
 {
 	struct expire_mail_user *euser =
 		EXPIRE_USER_CONTEXT(box->storage->user);
-	struct mail_namespace *ns = mailbox_list_get_namespace(box->list);
-	unsigned int secs;
-	bool altmove;
-
-	if (euser != NULL) {
-		secs = expire_box_find_min_secs(euser->env, box->vname,
-						&altmove);
-		if (secs != 0)
-			mailbox_expire_hook(box, secs, altmove);
-	}
+
+	if (euser != NULL)
+		expire_mailbox_allocate_init(box, euser);
 
 	if (next_hook_mailbox_allocated != NULL)
 		next_hook_mailbox_allocated(box);


More information about the dovecot-cvs mailing list