master-settings.h revision fe594abcaff07e7f69be1ce3bfcc7a62ff033e74
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd#ifndef __MASTER_SETTINGS_H
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd#define __MASTER_SETTINGS_H
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndenum mail_protocol {
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd MAIL_PROTOCOL_ANY,
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd MAIL_PROTOCOL_IMAP,
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd MAIL_PROTOCOL_POP3
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd};
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndstruct settings {
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct server_settings *server;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd enum mail_protocol protocol;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd /* common */
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *base_dir;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *log_path;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *info_log_path;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *log_timestamp;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd /* general */
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *protocols;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *listen;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *ssl_listen;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int ssl_disable;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *ssl_ca_file;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *ssl_cert_file;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *ssl_key_file;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *ssl_parameters_file;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int ssl_parameters_regenerate;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *ssl_cipher_list;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int ssl_verify_client_cert;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int disable_plaintext_auth;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int verbose_ssl;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd /* login */
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *login_dir;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *login_executable;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *login_user;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int login_process_per_connection;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int login_chroot;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int login_process_size;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int login_processes_count;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int login_max_processes_count;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int login_max_logging_users;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd /* mail */
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *valid_chroot_dirs;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mail_chroot;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int max_mail_processes;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int verbose_proctitle;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int first_valid_uid, last_valid_uid;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int first_valid_gid, last_valid_gid;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mail_extra_groups;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *default_mail_env;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mail_cache_fields;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mail_never_cache_fields;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int mailbox_check_interval;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int mailbox_idle_check_interval;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int mail_full_filesystem_access;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int mail_max_keyword_length;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int mail_save_crlf;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int mail_read_mmaped;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int mmap_disable;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int mmap_no_write;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int fcntl_locks_disable;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int maildir_stat_dirs;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int maildir_copy_with_hardlinks;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int maildir_check_content_changes;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mbox_read_locks;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mbox_write_locks;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int mbox_lock_timeout;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int mbox_dotlock_change_timeout;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int umask;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int mail_drop_priv_before_exec;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mail_executable;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int mail_process_size;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int mail_use_modules;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mail_modules;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mail_log_prefix;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd /* imap */
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int imap_max_line_length;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *imap_capability;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *imap_client_workarounds;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd /* pop3 */
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int pop3_mails_keep_recent;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *pop3_client_workarounds;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd /* .. */
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd uid_t login_uid;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int listen_fd, ssl_listen_fd;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd};
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndstruct socket_settings {
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *path;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int mode;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *user;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *group;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd};
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndstruct auth_socket_settings {
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct auth_settings *parent;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct auth_socket_settings *next;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *type;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct socket_settings master;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct socket_settings client;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd};
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndstruct auth_settings {
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct server_settings *parent;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct auth_settings *next;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *name;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *mechanisms;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *realms;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *default_realm;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *userdb;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *passdb;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *executable;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *user;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *chroot;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *username_chars;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *anonymous_username;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int use_cyrus_sasl, verbose, debug;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int ssl_require_client_cert;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int count;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd unsigned int process_size;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd /* .. */
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd uid_t uid;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd gid_t gid;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct auth_socket_settings *sockets;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd};
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndstruct namespace_settings {
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct server_settings *parent;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct namespace_settings *next;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *type;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *separator;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *prefix;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *location;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int inbox;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd int hidden;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd};
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndstruct server_settings {
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct server_settings *next;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd const char *name;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct settings *defaults;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct settings *imap;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct settings *pop3;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct auth_settings *auths;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct auth_settings auth_defaults;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd struct namespace_settings *namespaces;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd gid_t login_gid;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd};
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndextern struct server_settings *settings_root;
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndint master_settings_read(const char *path, int nochecks);
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndvoid master_settings_init(void);
08bc8956dd24148ba8ab24184e1c81e9f2354d69ndvoid master_settings_deinit(void);
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd#endif
08bc8956dd24148ba8ab24184e1c81e9f2354d69nd