changeset 8471:f82ba0d5ed30 HEAD

Expire plugin works now with multiple struct mail_users.
author Timo Sirainen <tss@iki.fi>
date Fri, 21 Nov 2008 19:56:42 +0200
parents e4f319453cb2
children ae30ea8532ee
files src/plugins/expire/expire-plugin.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/expire/expire-plugin.c	Fri Nov 21 19:45:57 2008 +0200
+++ b/src/plugins/expire/expire-plugin.c	Fri Nov 21 19:56:42 2008 +0200
@@ -21,7 +21,6 @@
 struct expire {
 	struct dict *db;
 	struct expire_env *env;
-	const char *username;
 
 	void (*next_hook_mail_storage_created)(struct mail_storage *storage);
 };
@@ -124,7 +123,8 @@
 	if (xt->first_expunged || xt->saves) T_BEGIN {
 		const char *key, *value;
 
-		key = t_strconcat(DICT_EXPIRE_PREFIX, expire.username, "/",
+		key = t_strconcat(DICT_EXPIRE_PREFIX,
+				  box->storage->ns->user->username, "/",
 				  box->storage->ns->prefix, box->name, NULL);
 		if (!xt->first_expunged && xt->saves) {
 			/* saved new mails. dict needs to be updated only if
@@ -296,10 +296,10 @@
 		if (dict_uri == NULL)
 			i_fatal("expire plugin: expire_dict setting missing");
 
-		// FIXME: user should be per-mail_user?...
-		expire.username = getenv("USER");
 		expire.env = expire_env_init(expunge_env, altmove_env);
-		expire.db = dict_init(dict_uri, DICT_DATA_TYPE_UINT32, expire.username);
+		/* we're using only shared dictionary, the username
+		   doesn't matter. */
+		expire.db = dict_init(dict_uri, DICT_DATA_TYPE_UINT32, "");
 		if (expire.db == NULL)
 			i_fatal("expire plugin: dict_init() failed");