mbox-settings.c revision bcb4e51a409d94ae670de96afb8483a4f7855294
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync/* Copyright (c) 2005-2018 Dovecot authors, see the included COPYING file */
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync#include "lib.h"
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#include "settings-parser.h"
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#include "mail-storage-settings.h"
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#include "mbox-settings.h"
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#include <stddef.h>
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#undef DEF
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#define DEF(type, name) \
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync { type, #name, offsetof(struct mbox_settings, name), NULL }
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsyncstatic const struct setting_define mbox_setting_defines[] = {
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync DEF(SET_STR, mbox_read_locks),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync DEF(SET_STR, mbox_write_locks),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync DEF(SET_TIME, mbox_lock_timeout),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync DEF(SET_TIME, mbox_dotlock_change_timeout),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync DEF(SET_SIZE, mbox_min_index_size),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync DEF(SET_BOOL, mbox_dirty_syncs),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync DEF(SET_BOOL, mbox_very_dirty_syncs),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync DEF(SET_BOOL, mbox_lazy_writes),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync DEF(SET_ENUM, mbox_md5),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync SETTING_DEFINE_LIST_END
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync};
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsyncstatic const struct mbox_settings mbox_default_settings = {
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .mbox_read_locks = "fcntl",
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .mbox_write_locks = "dotlock fcntl",
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .mbox_lock_timeout = 5*60,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .mbox_dotlock_change_timeout = 2*60,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .mbox_min_index_size = 0,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .mbox_dirty_syncs = TRUE,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .mbox_very_dirty_syncs = FALSE,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .mbox_lazy_writes = TRUE,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .mbox_md5 = "apop3d:all"
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync};
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsyncstatic const struct setting_parser_info mbox_setting_parser_info = {
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .module_name = "mbox",
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .defines = mbox_setting_defines,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .defaults = &mbox_default_settings,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .type_offset = (size_t)-1,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .struct_size = sizeof(struct mbox_settings),
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .parent_offset = (size_t)-1,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync .parent = &mail_user_setting_parser_info
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync};
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsyncconst struct setting_parser_info *mbox_get_setting_parser_info(void)
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync{
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync return &mbox_setting_parser_info;
004d34f82d0e8a4d58a65cc50eacf298bc6eb956vboxsync}
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync