Mercurial > dovecot > original-hg > dovecot-1.2
changeset 9102:531083e6e84a HEAD
expire-tool: Make sure expire plugin won't get used.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 31 May 2009 20:04:55 -0400 |
parents | 6fd725b94504 |
children | 1877cf23eec7 |
files | src/plugins/expire/expire-tool.c |
diffstat | 1 files changed, 13 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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");