bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2005-2018 Dovecot authors, see the included COPYING file */
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include "lib.h"
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include "settings-parser.h"
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include "mail-storage-settings.h"
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include "mbox-settings.h"
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include <stddef.h>
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#undef DEF
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#define DEF(type, name) \
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen { type, #name, offsetof(struct mbox_settings, name), NULL }
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct setting_define mbox_setting_defines[] = {
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_STR, mbox_read_locks),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_STR, mbox_write_locks),
50e20db49f29917fe9adcf1b56b11badf28bd0e4Timo Sirainen DEF(SET_TIME, mbox_lock_timeout),
50e20db49f29917fe9adcf1b56b11badf28bd0e4Timo Sirainen DEF(SET_TIME, mbox_dotlock_change_timeout),
61618d4c58080570f689614fec204ae14e90cef2Timo Sirainen DEF(SET_SIZE, mbox_min_index_size),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_BOOL, mbox_dirty_syncs),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_BOOL, mbox_very_dirty_syncs),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_BOOL, mbox_lazy_writes),
9743e5ac5bf6391157a4d1ab7119872b0979f8b7Timo Sirainen DEF(SET_ENUM, mbox_md5),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen SETTING_DEFINE_LIST_END
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen};
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct mbox_settings mbox_default_settings = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .mbox_read_locks = "fcntl",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .mbox_write_locks = "dotlock fcntl",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .mbox_lock_timeout = 5*60,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .mbox_dotlock_change_timeout = 2*60,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .mbox_min_index_size = 0,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .mbox_dirty_syncs = TRUE,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .mbox_very_dirty_syncs = FALSE,
9743e5ac5bf6391157a4d1ab7119872b0979f8b7Timo Sirainen .mbox_lazy_writes = TRUE,
9743e5ac5bf6391157a4d1ab7119872b0979f8b7Timo Sirainen .mbox_md5 = "apop3d:all"
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen};
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct setting_parser_info mbox_setting_parser_info = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .module_name = "mbox",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .defines = mbox_setting_defines,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .defaults = &mbox_default_settings,
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .type_offset = (size_t)-1,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .struct_size = sizeof(struct mbox_settings),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .parent_offset = (size_t)-1,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .parent = &mail_user_setting_parser_info
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen};
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainenconst struct setting_parser_info *mbox_get_setting_parser_info(void)
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen{
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen return &mbox_setting_parser_info;
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen}