# HG changeset patch # User Timo Sirainen # Date 1243814695 14400 # Node ID 531083e6e84a3a93791a6c383b42f30b19571d5c # Parent 6fd725b9450469e4b077ce901c6bcf46184e44db expire-tool: Make sure expire plugin won't get used. 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,9 +229,20 @@ 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; else { @@ -253,11 +264,6 @@ 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 @@ 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");