"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/plugins/lazy-expunge/lazy-expunge-plugin.c" between
dovecot-2.3.16.tar.gz and dovecot-2.3.17.tar.gz

About: Dovecot is an IMAP and POP3 server, written with security primarily in mind.

lazy-expunge-plugin.c  (dovecot-2.3.16):lazy-expunge-plugin.c  (dovecot-2.3.17)
skipping to change at line 13 skipping to change at line 13
#include "lib.h" #include "lib.h"
#include "ioloop.h" #include "ioloop.h"
#include "array.h" #include "array.h"
#include "str.h" #include "str.h"
#include "hash.h" #include "hash.h"
#include "seq-range-array.h" #include "seq-range-array.h"
#include "mkdir-parents.h" #include "mkdir-parents.h"
#include "mail-storage-private.h" #include "mail-storage-private.h"
#include "mail-search-build.h" #include "mail-search-build.h"
#include "mailbox-list-private.h" #include "mailbox-list-private.h"
#include "mailbox-match-plugin.h"
#include "mail-namespace.h" #include "mail-namespace.h"
#include "lazy-expunge-plugin.h" #include "lazy-expunge-plugin.h"
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <dirent.h> #include <dirent.h>
#include <time.h> #include <time.h>
#define LAZY_EXPUNGE_CONTEXT(obj) \ #define LAZY_EXPUNGE_CONTEXT(obj) \
MODULE_CONTEXT(obj, lazy_expunge_mail_storage_module) MODULE_CONTEXT(obj, lazy_expunge_mail_storage_module)
skipping to change at line 46 skipping to change at line 47
struct lazy_expunge_mail { struct lazy_expunge_mail {
union mail_module_context module_ctx; union mail_module_context module_ctx;
bool moving; bool moving;
bool recursing; bool recursing;
}; };
struct lazy_expunge_mail_user { struct lazy_expunge_mail_user {
union mail_user_module_context module_ctx; union mail_user_module_context module_ctx;
struct mail_namespace *lazy_ns; struct mail_namespace *lazy_ns;
struct mailbox_match_plugin *excludes;
const char *lazy_mailbox_vname; const char *lazy_mailbox_vname;
const char *env; const char *env;
bool copy_only_last_instance; bool copy_only_last_instance;
}; };
struct lazy_expunge_mailbox_list { struct lazy_expunge_mailbox_list {
union mailbox_list_module_context module_ctx; union mailbox_list_module_context module_ctx;
bool allow_rename:1; bool allow_rename:1;
bool internal_namespace:1; bool internal_namespace:1;
skipping to change at line 266 skipping to change at line 268
} }
if (llist->internal_namespace) { if (llist->internal_namespace) {
/* lazy-expunge namespace */ /* lazy-expunge namespace */
return TRUE; return TRUE;
} }
if (luser->lazy_mailbox_vname != NULL && if (luser->lazy_mailbox_vname != NULL &&
strcmp(luser->lazy_mailbox_vname, box->vname) == 0) { strcmp(luser->lazy_mailbox_vname, box->vname) == 0) {
/* lazy-expunge mailbox */ /* lazy-expunge mailbox */
return TRUE; return TRUE;
} }
if (mailbox_match_plugin_exclude(luser->excludes, box)) {
/* Mailbox explicitly excluded by configuration */
return TRUE;
}
return FALSE; return FALSE;
} }
static void lazy_expunge_set_error(struct lazy_expunge_transaction *lt, static void lazy_expunge_set_error(struct lazy_expunge_transaction *lt,
struct mail_storage *storage) struct mail_storage *storage)
{ {
const char *errstr; const char *errstr;
enum mail_error error; enum mail_error error;
errstr = mail_storage_get_last_error(storage, &error); errstr = mail_storage_get_last_error(storage, &error);
skipping to change at line 583 skipping to change at line 589
mail_namespace_ref(luser->lazy_ns); mail_namespace_ref(luser->lazy_ns);
} }
static void lazy_expunge_user_deinit(struct mail_user *user) static void lazy_expunge_user_deinit(struct mail_user *user)
{ {
struct lazy_expunge_mail_user *luser = LAZY_EXPUNGE_USER_CONTEXT_REQUIRE( user); struct lazy_expunge_mail_user *luser = LAZY_EXPUNGE_USER_CONTEXT_REQUIRE( user);
/* mail_namespaces_created hook isn't necessarily ever called */ /* mail_namespaces_created hook isn't necessarily ever called */
if (luser->lazy_ns != NULL) if (luser->lazy_ns != NULL)
mail_namespace_unref(&luser->lazy_ns); mail_namespace_unref(&luser->lazy_ns);
mailbox_match_plugin_deinit(&luser->excludes);
luser->module_ctx.super.deinit(user); luser->module_ctx.super.deinit(user);
} }
static void lazy_expunge_mail_user_created(struct mail_user *user) static void lazy_expunge_mail_user_created(struct mail_user *user)
{ {
struct mail_user_vfuncs *v = user->vlast; struct mail_user_vfuncs *v = user->vlast;
struct lazy_expunge_mail_user *luser; struct lazy_expunge_mail_user *luser;
const char *env; const char *env;
env = mail_user_plugin_getenv(user, "lazy_expunge"); env = mail_user_plugin_getenv(user, "lazy_expunge");
if (env != NULL && env[0] != '\0') { if (env != NULL && env[0] != '\0') {
luser = p_new(user->pool, struct lazy_expunge_mail_user, 1); luser = p_new(user->pool, struct lazy_expunge_mail_user, 1);
luser->module_ctx.super = *v; luser->module_ctx.super = *v;
user->vlast = &luser->module_ctx.super; user->vlast = &luser->module_ctx.super;
v->deinit = lazy_expunge_user_deinit; v->deinit = lazy_expunge_user_deinit;
luser->env = env; luser->env = env;
luser->copy_only_last_instance = luser->copy_only_last_instance =
mail_user_plugin_getenv_bool(user, "lazy_expunge_only_las t_instance"); mail_user_plugin_getenv_bool(user, "lazy_expunge_only_las t_instance");
luser->excludes = mailbox_match_plugin_init(user, "lazy_expunge_e xclude");
MODULE_CONTEXT_SET(user, lazy_expunge_mail_user_module, luser); MODULE_CONTEXT_SET(user, lazy_expunge_mail_user_module, luser);
} else { } else {
e_debug(user->event, "lazy_expunge: No lazy_expunge setting - " e_debug(user->event, "lazy_expunge: No lazy_expunge setting - "
"plugin disabled"); "plugin disabled");
} }
} }
static struct mail_storage_hooks lazy_expunge_mail_storage_hooks = { static struct mail_storage_hooks lazy_expunge_mail_storage_hooks = {
.mail_user_created = lazy_expunge_mail_user_created, .mail_user_created = lazy_expunge_mail_user_created,
 End of changes. 5 change blocks. 
0 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)