mail-storage-settings.h revision d2e74f2af690b8e2d536400f02f397cbed1334b7
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny#ifndef MAIL_STORAGE_SETTINGS_H
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny#define MAIL_STORAGE_SETTINGS_H
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny#include "file-lock.h"
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny#include "fsync-mode.h"
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny#define MAIL_STORAGE_SET_DRIVER_NAME "MAIL"
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenystruct mail_user;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenystruct mail_storage;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenystruct mail_storage_settings {
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_location;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_attachment_fs;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_attachment_dir;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_attachment_hash;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny uoff_t mail_attachment_min_size;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_attribute_dict;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny unsigned int mail_prefetch_count;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_cache_fields;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_always_cache_fields;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_never_cache_fields;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny unsigned int mail_cache_min_mail_count;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny unsigned int mailbox_idle_check_interval;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny unsigned int mail_max_keyword_length;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny unsigned int mail_max_lock_timeout;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny unsigned int mail_temp_scan_interval;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool mail_save_crlf;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_fsync;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool mmap_disable;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool dotlock_use_excl;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool mail_nfs_storage;
1330390c698ca0802200725df43356557aa633a2Justin Stephenson bool mail_nfs_index;
1330390c698ca0802200725df43356557aa633a2Justin Stephenson bool mailbox_list_index;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool mail_debug;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool mail_full_filesystem_access;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool maildir_stat_dirs;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool mail_shared_explicit_inbox;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *lock_method;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *pop3_uidl_format;
9651a27ec14f3a378e861ca39852480f37f1ef08Michal Zidek
9651a27ec14f3a378e861ca39852480f37f1ef08Michal Zidek const char *ssl_client_ca_dir;
9651a27ec14f3a378e861ca39852480f37f1ef08Michal Zidek const char *ssl_client_ca_file;
9651a27ec14f3a378e861ca39852480f37f1ef08Michal Zidek const char *ssl_crypto_device;
9651a27ec14f3a378e861ca39852480f37f1ef08Michal Zidek
9651a27ec14f3a378e861ca39852480f37f1ef08Michal Zidek enum file_lock_method parsed_lock_method;
a2407fc21be3e9e5006cc575aae01ed1216138dbLukas Slebodnik enum fsync_mode parsed_fsync_mode;
9651a27ec14f3a378e861ca39852480f37f1ef08Michal Zidek};
9651a27ec14f3a378e861ca39852480f37f1ef08Michal Zidek
9651a27ec14f3a378e861ca39852480f37f1ef08Michal Zidekstruct mail_namespace_settings {
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *name;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *type;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *separator;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *prefix;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *location;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *alias_for;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool inbox;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool hidden;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *list;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool subscriptions;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool ignore_on_failure;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny bool disabled;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny ARRAY(struct mailbox_settings *) mailboxes;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny struct mail_user_settings *user_set;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny};
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny/* <settings checks> */
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny#define MAILBOX_SET_AUTO_NO "no"
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny#define MAILBOX_SET_AUTO_CREATE "create"
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny#define MAILBOX_SET_AUTO_SUBSCRIBE "subscribe"
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny/* </settings checks> */
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenystruct mailbox_settings {
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *name;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *autocreate;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *special_use;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *driver;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny};
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenystruct mail_user_settings {
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *base_dir;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *auth_socket_path;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_temp_dir;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_uid;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_gid;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_home;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_chroot;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_access_groups;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_privileged_group;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *valid_chroot_dirs;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny unsigned int first_valid_uid, last_valid_uid;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny unsigned int first_valid_gid, last_valid_gid;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_plugins;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_plugin_dir;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *mail_log_prefix;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny ARRAY(struct mail_namespace_settings *) namespaces;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny ARRAY(const char *) plugin_envs;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny};
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenyextern const struct setting_parser_info mail_user_setting_parser_info;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenyextern const struct setting_parser_info mail_namespace_setting_parser_info;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenyextern const struct setting_parser_info mail_storage_setting_parser_info;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenyextern const struct mail_namespace_settings mail_namespace_default_settings;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenyextern const struct mailbox_settings mailbox_default_settings;
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenyconst void *
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenymail_user_set_get_driver_settings(const struct setting_parser_info *info,
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const struct mail_user_settings *set,
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zeleny const char *driver);
13857cf3d073b697cd037788ceabde7eb41a22c0Jan Zelenyconst struct mail_storage_settings *
82b5429d1438392c45e70a0f84dd4d0f5fa1a171Jakub Hrozekmail_user_set_get_storage_set(struct mail_user *user);
82b5429d1438392c45e70a0f84dd4d0f5fa1a171Jakub Hrozekconst void *mail_storage_get_driver_settings(struct mail_storage *storage);
82b5429d1438392c45e70a0f84dd4d0f5fa1a171Jakub Hrozek
82b5429d1438392c45e70a0f84dd4d0f5fa1a171Jakub Hrozekconst struct dynamic_settings_parser *
82b5429d1438392c45e70a0f84dd4d0f5fa1a171Jakub Hrozekmail_storage_get_dynamic_parsers(pool_t pool);
82b5429d1438392c45e70a0f84dd4d0f5fa1a171Jakub Hrozek
82b5429d1438392c45e70a0f84dd4d0f5fa1a171Jakub Hrozek#endif
82b5429d1438392c45e70a0f84dd4d0f5fa1a171Jakub Hrozek