changeset 19537:304b06f6302c

lib-storage: Fixed autoexpunge for namespaces with non-empty prefix
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 04 Jan 2016 14:23:46 -0500
parents c4f960341b0c
children dfee8dea71b6
files src/lib-storage/mail-autoexpunge.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/mail-autoexpunge.c	Mon Jan 04 14:15:50 2016 -0500
+++ b/src/lib-storage/mail-autoexpunge.c	Mon Jan 04 14:23:46 2016 -0500
@@ -63,6 +63,7 @@
 	struct mailbox_settings *const *box_set;
 	struct mailbox *box;
 	time_t expire_time;
+	const char *vname;
 
 	if (!array_is_created(&ns->set->mailboxes))
 		return;
@@ -71,8 +72,10 @@
 		if ((*box_set)->autoexpunge == 0 ||
 		    (unsigned int)ioloop_time < (*box_set)->autoexpunge)
 			continue;
+
+		vname = t_strconcat(ns->prefix, (*box_set)->name, NULL);
 		expire_time = ioloop_time - (*box_set)->autoexpunge;
-		box = mailbox_alloc(ns->list, (*box_set)->name, 0);
+		box = mailbox_alloc(ns->list, vname, 0);
 		if (mailbox_autoexpunge(box, expire_time) < 0) {
 			i_error("Failed to autoexpunge mailbox '%s': %s",
 				mailbox_get_vname(box),