Skip to content

Commit

Permalink
lib-storage: Fixed autoexpunge=yes to work with namespace's root mail…
Browse files Browse the repository at this point in the history
…box.

namespace { mailbox "" { autoexpunge = .. } }
  • Loading branch information
sirainen committed Jan 13, 2016
1 parent 40bdcc2 commit 43bdd92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib-storage/mail-autoexpunge.c
Expand Up @@ -73,7 +73,11 @@ static void mail_namespace_autoexpunge(struct mail_namespace *ns)
(unsigned int)ioloop_time < (*box_set)->autoexpunge)
continue;

vname = t_strconcat(ns->prefix, (*box_set)->name, NULL);
if ((*box_set)->name[0] == '\0' && ns->prefix_len > 0 &&
ns->prefix[ns->prefix_len-1] == mail_namespace_get_sep(ns))
vname = t_strndup(ns->prefix, ns->prefix_len - 1);
else
vname = t_strconcat(ns->prefix, (*box_set)->name, NULL);
expire_time = ioloop_time - (*box_set)->autoexpunge;
box = mailbox_alloc(ns->list, vname, 0);
if (mailbox_autoexpunge(box, expire_time) < 0) {
Expand Down

0 comments on commit 43bdd92

Please sign in to comment.