mail-autoexpunge.c revision 43bdd923915368a6eaa32695ac2aec448574c18b
/* Copyright (c) 2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "mail-storage-private.h"
#include "mail-namespace.h"
#include "mail-user.h"
#include "mail-autoexpunge.h"
{
struct mailbox_transaction_context *t;
struct mailbox_metadata metadata;
const struct mail_index_header *hdr;
int ret = 0;
/* first try to check quickly from mailbox list index if we should
bother opening this mailbox. */
&metadata) == 0) {
return 0;
}
/* autocreated mailbox doesn't exist yet */
return 0;
}
return -1;
}
t = mailbox_transaction_begin(box, 0);
if (timestamp > expire_time)
break;
/* already expunged */
} else {
/* failed */
ret = -1;
break;
}
}
if (mailbox_transaction_commit(&t) < 0)
ret = -1;
return ret;
}
{
struct mailbox_settings *const *box_set;
const char *vname;
return;
if ((*box_set)->autoexpunge == 0 ||
continue;
else
i_error("Failed to autoexpunge mailbox '%s': %s",
}
mailbox_free(&box);
}
}
{
struct mail_namespace *ns;
}
}