expire-plugin.c revision eddd9bf1a1369aea4a2715f6be1137da6d17d293
/* Copyright (c) 2006-2007 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "array.h"
#include "dict.h"
#include "mail-namespace.h"
#include "index-mail.h"
#include "index-storage.h"
#include "expire-env.h"
#include "expire-plugin.h"
#include <stdlib.h>
#define EXPIRE_CONTEXT(obj) \
#define EXPIRE_MAIL_CONTEXT(obj) \
struct expire {
struct expire_env *env;
const char *username;
};
struct expire_mailbox {
union mailbox_module_context module_ctx;
};
struct expire_transaction_context {
unsigned int first_expunged:1;
};
const char *expire_plugin_version = PACKAGE_VERSION;
static struct mailbox_transaction_context *
{
struct mailbox_transaction_context *t;
struct expire_transaction_context *xt;
return t;
}
{
struct index_transaction_context *t =
(struct index_transaction_context *)_t;
const struct mail_index_header *hdr;
/* find the first non-expunged mail. we're here because the first
mail was expunged, so don't bother checking it. */
return;
}
}
/* everything expunged */
*stamp_r = 0;
}
static int
{
bool update_dict = FALSE;
int ret;
if (xt->first_expunged) {
/* first mail expunged. dict needs updating. */
update_dict = TRUE;
}
first_saved_uid_r, last_saved_uid_r) < 0) {
return -1;
}
mailbox_name, NULL);
if (!xt->first_expunged) {
/* saved new mails. dict needs to be updated only if
this is the first mail in the database */
}
if (update_dict) {
struct dict_transaction_context *dctx;
}
} T_FRAME_END;
return 0;
}
static void
{
}
{
struct expire_transaction_context *xt =
/* first mail expunged, database needs to be updated */
}
}
static struct mail *
expire_mail_alloc(struct mailbox_transaction_context *t,
struct mailbox_header_lookup_ctx *wanted_headers)
{
union mail_module_context *xpr_mail;
struct mail_private *mail;
return _mail;
}
static void
{
struct index_transaction_context *it =
(struct index_transaction_context *)t;
if (xt->first_save_time == 0)
&ioloop_time, sizeof(ioloop_time));
}
static int
expire_save_init(struct mailbox_transaction_context *t,
{
int ret;
if (ret >= 0)
return ret;
}
static int
{
int ret;
if (ret >= 0)
return ret;
}
{
struct expire_mailbox *xpr_box;
}
static struct mailbox *
{
union mail_storage_module_context *xpr_storage =
const struct expire_box *expire_box;
const char *full_name;
if (expire_box != NULL)
}
return box;
}
{
}
void expire_plugin_init(void)
{
i_fatal("expire plugin: expire_dict setting missing");
}
}
void expire_plugin_deinit(void)
{
}
}