imap-login-settings.c revision 7bafda1813454621e03615e83d55bccfa7cc56bd
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen#include "lib.h"
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen#include "settings-parser.h"
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen#include "service-settings.h"
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen#include "login-settings.h"
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen#include "imap-login-settings.h"
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen#include <stddef.h>
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainenstruct service_settings imap_login_service_settings = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .name = "imap-login",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .protocol = "imap",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .type = "login",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .executable = "imap-login",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .user = "dovecot",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .group = "",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .privileged_group = "",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .extra_groups = "",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .chroot = "login",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .drop_priv_before_exec = FALSE,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .process_min_avail = 0,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .process_limit = 0,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .client_limit = 0,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .service_count = 1,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .vsz_limit = 64,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .unix_listeners = ARRAY_INIT,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .fifo_listeners = ARRAY_INIT,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .inet_listeners = ARRAY_INIT
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen};
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen#undef DEF
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen#define DEF(type, name) \
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen { type, #name, offsetof(struct imap_login_settings, name), NULL }
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct setting_define imap_login_setting_defines[] = {
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen DEF(SET_STR, imap_capability),
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen SETTING_DEFINE_LIST_END
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen};
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct imap_login_settings imap_login_default_settings = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .imap_capability = ""
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen};
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct setting_parser_info *imap_login_setting_dependencies[] = {
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen &login_setting_parser_info,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen NULL
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen};
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct setting_parser_info imap_login_setting_parser_info = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .module_name = "imap-login",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .defines = imap_login_setting_defines,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .defaults = &imap_login_default_settings,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .type_offset = (size_t)-1,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .struct_size = sizeof(struct imap_login_settings),
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .parent_offset = (size_t)-1,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .dependencies = imap_login_setting_dependencies
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen};
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainenconst struct setting_parser_info *imap_login_setting_roots[] = {
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen &login_setting_parser_info,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen &imap_login_setting_parser_info,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen NULL
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen};