imap-login-settings.c revision 9f0f2de10e4ea0c99052bf4b2bef8179f2536228
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 = {
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(name) "imap-login",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(protocol) "imap",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(type) "login",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(executable) "imap-login",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(user) "dovecot",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(group) "",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(privileged_group) "",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(extra_groups) "",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(chroot) "login",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(drop_priv_before_exec) FALSE,
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(process_min_avail) 0,
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(process_limit) 0,
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(client_limit) 0,
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(service_count) 1,
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(vsz_limit) 64,
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(unix_listeners) ARRAY_INIT,
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(fifo_listeners) ARRAY_INIT,
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen MEMBER(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 = {
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(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 = {
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(module_name) "imap-login",
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(defines) imap_login_setting_defines,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(defaults) &imap_login_default_settings,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(type_offset) (size_t)-1,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(struct_size) sizeof(struct imap_login_settings),
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(parent_offset) (size_t)-1,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(parent) NULL,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(check_func) NULL,
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen MEMBER(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};