.defaults = &mdbox_default_settings,
.struct_size = sizeof(struct mdbox_settings),
+ .pool_offset1 = 1 + offsetof(struct mdbox_settings, pool),
.parent = &mail_user_setting_parser_info
};
#define MDBOX_SETTINGS_H
struct mdbox_settings {
+ pool_t pool;
bool mdbox_preallocate_space;
uoff_t mdbox_rotate_size;
unsigned int mdbox_rotate_interval;
#include "ioloop.h"
#include "mkdir-parents.h"
#include "master-service.h"
+#include "master-service-settings.h"
#include "settings-parser.h"
#include "mail-index-modseq.h"
#include "mail-index-alloc-cache.h"
struct mdbox_storage *storage = MDBOX_STORAGE(_storage);
const char *dir;
- storage->set = settings_parser_get_root_set(_storage->user->set_parser,
- mdbox_get_setting_parser_info());
+ if (master_service_settings_parser_get(_storage->event,
+ _storage->user->set_parser,
+ mdbox_get_setting_parser_info(),
+ MASTER_SERVICE_SETTINGS_GET_FLAG_NO_EXPAND,
+ &storage->set, error_r) < 0)
+ return -1;
+
storage->preallocate_space = storage->set->mdbox_preallocate_space;
if (*ns->list->set.mailbox_dir_name == '\0') {
array_free(&storage->move_to_alt_map_uids);
array_free(&storage->open_files);
i_free(storage->corrupted_reason);
+ master_service_settings_free(storage->set);
dbox_storage_destroy(_storage);
}
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/lib-test \
-I$(top_srcdir)/src/lib-settings \
+ -I$(top_srcdir)/src/lib-master \
-I$(top_srcdir)/src/lib-mail \
-I$(top_srcdir)/src/lib-imap \
-I$(top_srcdir)/src/lib-imap-client \
.defaults = &imapc_default_settings,
.struct_size = sizeof(struct imapc_settings),
+ .pool_offset1 = 1 + offsetof(struct imapc_settings, pool),
.parent = &mail_user_setting_parser_info,
.check_func = imapc_settings_check
* serialization of settings.
*/
struct imapc_settings {
+ pool_t pool;
const char *imapc_host;
in_port_t imapc_port;
#include "ioloop.h"
#include "str.h"
#include "settings-parser.h"
+#include "master-service-settings.h"
#include "imap-arg.h"
#include "imap-resp-code.h"
#include "mailbox-tree.h"
struct imapc_client_settings set;
string_t *str;
- imapc_set = settings_parser_get_root_set(ns->user->set_parser,
- imapc_get_setting_parser_info());
+ if (master_service_settings_parser_get(ns->user->event,
+ ns->user->set_parser, imapc_get_setting_parser_info(),
+ MASTER_SERVICE_SETTINGS_GET_FLAG_NO_EXPAND,
+ &imapc_set, error_r) < 0)
+ return -1;
i_zero(&set);
set.host = imapc_set->imapc_host;
if (*set.host == '\0') {
*error_r = "missing imapc_host";
+ master_service_settings_free(imapc_set);
return -1;
}
set.port = imapc_set->imapc_port;
set.password = imapc_set->imapc_password;
if (*set.password == '\0') {
*error_r = "missing imapc_password";
+ master_service_settings_free(imapc_set);
return -1;
}
set.sasl_mechanisms = imapc_set->imapc_sasl_mechanisms;
if (--client->refcount > 0)
return;
imapc_client_deinit(&client->client);
+ master_service_settings_free(client->set);
array_foreach_modifiable(&client->untagged_callbacks, cb)
i_free(cb->name);
array_free(&client->untagged_callbacks);
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/lib-settings \
+ -I$(top_srcdir)/src/lib-master \
-I$(top_srcdir)/src/lib-mail \
-I$(top_srcdir)/src/lib-imap \
-I$(top_srcdir)/src/lib-index \
.defaults = &maildir_default_settings,
.struct_size = sizeof(struct maildir_settings),
+ .pool_offset1 = 1 + offsetof(struct maildir_settings, pool),
.parent = &mail_user_setting_parser_info
};
#define MAILDIR_SETTINGS_H
struct maildir_settings {
+ pool_t pool;
bool maildir_copy_with_hardlinks;
bool maildir_very_dirty_syncs;
bool maildir_broken_filename_sizes;
#include "eacces-error.h"
#include "unlink-old-files.h"
#include "settings-parser.h"
+#include "master-service-settings.h"
#include "mailbox-uidvalidity.h"
#include "mailbox-list-private.h"
#include "maildir-storage.h"
struct mailbox_list *list = ns->list;
const char *dir;
- storage->set = settings_parser_get_root_set(_storage->user->set_parser,
- maildir_get_setting_parser_info());
+ if (master_service_settings_parser_get(_storage->event,
+ _storage->user->set_parser,
+ maildir_get_setting_parser_info(),
+ MASTER_SERVICE_SETTINGS_GET_FLAG_NO_EXPAND,
+ &storage->set, error_r) < 0)
+ return -1;
storage->temp_prefix = p_strdup(_storage->pool,
mailbox_list_get_temp_prefix(list));
return 0;
}
+static void maildir_storage_destroy(struct mail_storage *_storage)
+{
+ struct maildir_storage *storage = MAILDIR_STORAGE(_storage);
+
+ master_service_settings_free(storage->set);
+ index_storage_destroy(_storage);
+}
+
static void maildir_storage_get_list_settings(const struct mail_namespace *ns,
struct mailbox_list_settings *set)
{
maildir_get_setting_parser_info,
maildir_storage_alloc,
maildir_storage_create,
- index_storage_destroy,
+ maildir_storage_destroy,
maildir_storage_add_list,
maildir_storage_get_list_settings,
maildir_storage_autodetect,
.defaults = &mbox_default_settings,
.struct_size = sizeof(struct mbox_settings),
+ .pool_offset1 = 1 + offsetof(struct mbox_settings, pool),
.parent = &mail_user_setting_parser_info
};
#define MBOX_SETTINGS_H
struct mbox_settings {
+ pool_t pool;
const char *mbox_read_locks;
const char *mbox_write_locks;
unsigned int mbox_lock_timeout;
#include "ostream.h"
#include "restrict-access.h"
#include "master-service.h"
+#include "master-service-settings.h"
#include "settings-parser.h"
#include "mailbox-list-private.h"
#include "mbox-storage.h"
return -1;
}
- storage->set = settings_parser_get_root_set(_storage->user->set_parser,
- mbox_get_setting_parser_info());
+ if (master_service_settings_parser_get(_storage->event,
+ _storage->user->set_parser,
+ mbox_get_setting_parser_info(),
+ MASTER_SERVICE_SETTINGS_GET_FLAG_NO_EXPAND,
+ &storage->set, error_r) < 0)
+ return -1;
if (mailbox_list_get_root_path(ns->list, MAILBOX_LIST_PATH_TYPE_INDEX, &dir)) {
_storage->temp_path_prefix = p_strconcat(_storage->pool, dir,
return 0;
}
+static void mbox_storage_destroy(struct mail_storage *_storage)
+{
+ struct mbox_storage *storage = MBOX_STORAGE(_storage);
+
+ master_service_settings_free(storage->set);
+ index_storage_destroy(_storage);
+}
+
static void mbox_storage_get_list_settings(const struct mail_namespace *ns,
struct mailbox_list_settings *set)
{
mbox_get_setting_parser_info,
mbox_storage_alloc,
mbox_storage_create,
- index_storage_destroy,
+ mbox_storage_destroy,
mbox_storage_add_list,
mbox_storage_get_list_settings,
mbox_storage_autodetect,
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/lib-settings \
+ -I$(top_srcdir)/src/lib-master \
-I$(top_srcdir)/src/lib-dns \
-I$(top_srcdir)/src/lib-ssl-iostream \
-I$(top_srcdir)/src/lib-mail \
.defaults = &pop3c_default_settings,
.struct_size = sizeof(struct pop3c_settings),
+ .pool_offset1 = 1 + offsetof(struct pop3c_settings, pool),
.parent = &mail_user_setting_parser_info,
.check_func = pop3c_settings_check
struct pop3c_settings {
+ pool_t pool;
const char *pop3c_host;
in_port_t pop3c_port;
#include "ioloop.h"
#include "str.h"
#include "settings-parser.h"
+#include "master-service-settings.h"
#include "mail-copy.h"
#include "mail-user.h"
#include "mailbox-list-private.h"
{
struct pop3c_storage *storage = POP3C_STORAGE(_storage);
- storage->set = settings_parser_get_root_set(_storage->user->set_parser,
- pop3c_get_setting_parser_info());
+ if (master_service_settings_parser_get(_storage->event,
+ _storage->user->set_parser,
+ pop3c_get_setting_parser_info(),
+ MASTER_SERVICE_SETTINGS_GET_FLAG_NO_EXPAND,
+ &storage->set, error_r) < 0)
+ return -1;
+
if (storage->set->pop3c_host[0] == '\0') {
*error_r = "missing pop3c_host";
return -1;
return 0;
}
+static void pop3c_storage_destroy(struct mail_storage *_storage)
+{
+ struct pop3c_storage *storage = POP3C_STORAGE(_storage);
+
+ master_service_settings_free(storage->set);
+ index_storage_destroy(_storage);
+}
+
static struct pop3c_client *
pop3c_client_create_from_set(struct mail_storage *storage,
const struct pop3c_settings *set)
pop3c_get_setting_parser_info,
pop3c_storage_alloc,
pop3c_storage_create,
- index_storage_destroy,
+ pop3c_storage_destroy,
NULL,
pop3c_storage_get_list_settings,
NULL,