dovecot-1.2: expire-tool: Make sure expire plugin won't get used.

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 1 03:05:02 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/531083e6e84a
changeset: 9102:531083e6e84a
user:      Timo Sirainen <tss at iki.fi>
date:      Sun May 31 20:04:55 2009 -0400
description:
expire-tool: Make sure expire plugin won't get used.

diffstat:

1 file changed, 13 insertions(+), 7 deletions(-)
src/plugins/expire/expire-tool.c |   20 +++++++++++++-------

diffs (45 lines):

diff -r 6fd725b94504 -r 531083e6e84a src/plugins/expire/expire-tool.c
--- a/src/plugins/expire/expire-tool.c	Sun May 31 19:59:47 2009 -0400
+++ b/src/plugins/expire/expire-tool.c	Sun May 31 20:04:55 2009 -0400
@@ -229,8 +229,19 @@ static void expire_run(bool testrun)
 	time_t oldest, expire_time;
 	unsigned int expunge_secs, altmove_secs;
 	const char *auth_socket, *p, *key, *value;
-	const char *userp, *mailbox;
+	const char *userp, *mailbox, *expire, *expire_altmove;
 	int ret;
+
+	expire = t_strdup(getenv("EXPIRE"));
+	expire_altmove = t_strdup(getenv("EXPIRE_ALTMOVE"));
+	if (expire == NULL && expire_altmove == NULL)
+		i_fatal("expire and expire_altmove settings not set");
+	if (getenv("EXPIRE_DICT") == NULL)
+		i_fatal("expire_dict setting not set");
+
+	/* remove these so that expire plugin won't get used */
+	env_remove("EXPIRE");
+	env_remove("EXPIRE_ALTMOVE");
 
 	if (getenv("MAIL_PLUGINS") == NULL)
 		modules = NULL;
@@ -253,11 +264,6 @@ static void expire_run(bool testrun)
 	mail_storage_register_all();
 	mailbox_list_register_all();
 
-	if (getenv("EXPIRE") == NULL && getenv("EXPIRE_ALTMOVE") == NULL)
-		i_fatal("expire and expire_altmove settings not set");
-	if (getenv("EXPIRE_DICT") == NULL)
-		i_fatal("expire_dict setting not set");
-
 	expire_get_global_mail_ids();
 
 	auth_socket = getenv("AUTH_SOCKET_PATH");
@@ -267,7 +273,7 @@ static void expire_run(bool testrun)
 	memset(&ctx, 0, sizeof(ctx));
 	ctx.testrun = testrun;
 	ctx.auth_conn = auth_master_init(auth_socket, getenv("DEBUG") != NULL);
-	env = expire_env_init(getenv("EXPIRE"), getenv("EXPIRE_ALTMOVE"));
+	env = expire_env_init(expire, expire_altmove);
 	dict = dict_init(getenv("EXPIRE_DICT"), DICT_DATA_TYPE_UINT32, "");
 	if (dict == NULL)
 		i_fatal("dict_init() failed");


More information about the dovecot-cvs mailing list