this is the first mail in the database */
ret = dict_lookup(expire.db, pool_datastack_create(),
key, &value);
- update_dict = ret == 0 || strtoul(value, NULL, 10) == 0;
+ update_dict = ret == 0 ||
+ (ret > 0 && strtoul(value, NULL, 10) == 0);
/* may not be exactly the first message's save time
but a few second difference doesn't matter */
new_stamp = ioloop_time;
expire.env = expire_env_init(expunge_env, altmove_env);
expire.db = dict_init(dict_uri, DICT_DATA_TYPE_UINT32, NULL);
+ if (expire.db == NULL)
+ i_fatal("expire plugin: dict_init() failed");
expire.username = getenv("USER");
expire.next_hook_mail_storage_created =
ctx.namespace_pool = pool_alloconly_create("namespaces", 1024);
env = expire_env_init(getenv("EXPIRE"), getenv("EXPIRE_ALTMOVE"));
dict = dict_init(getenv("EXPIRE_DICT"), DICT_DATA_TYPE_UINT32, "");
+ if (dict == NULL)
+ i_fatal("dict_init() failed");
+
trans = dict_transaction_begin(dict);
iter = dict_iterate_init(dict, DICT_PATH_SHARED,
DICT_ITERATE_FLAG_SORT_BY_VALUE);