master-settings.h revision 4426132a36ad4d5ba421f7bae9709f91fef37180
132N/A#ifndef __MASTER_SETTINGS_H
132N/A#define __MASTER_SETTINGS_H
132N/A
132N/A#include "network.h"
132N/A
132N/Aenum mail_protocol {
132N/A MAIL_PROTOCOL_ANY,
132N/A MAIL_PROTOCOL_IMAP,
132N/A MAIL_PROTOCOL_POP3,
132N/A MAIL_PROTOCOL_LDA
132N/A};
132N/A
132N/Astruct listener {
132N/A struct ip_addr ip;
132N/A unsigned int port;
132N/A int fd;
132N/A bool wanted;
132N/A};
132N/AARRAY_DEFINE_TYPE(listener, struct listener);
132N/A
132N/Astruct settings {
132N/A struct server_settings *server;
132N/A enum mail_protocol protocol;
132N/A
144N/A /* common */
132N/A const char *base_dir;
132N/A const char *log_path;
132N/A const char *info_log_path;
132N/A const char *log_timestamp;
132N/A const char *syslog_facility;
132N/A
132N/A /* general */
132N/A const char *protocols;
132N/A const char *listen;
132N/A const char *ssl_listen;
132N/A
132N/A bool ssl_disable;
132N/A const char *ssl_ca_file;
132N/A const char *ssl_cert_file;
132N/A const char *ssl_key_file;
132N/A const char *ssl_key_password;
132N/A unsigned int ssl_parameters_regenerate;
132N/A const char *ssl_cipher_list;
132N/A bool ssl_verify_client_cert;
132N/A bool disable_plaintext_auth;
132N/A bool verbose_ssl;
132N/A bool shutdown_clients;
132N/A bool nfs_check;
132N/A bool version_ignore;
132N/A
132N/A /* login */
132N/A const char *login_dir;
132N/A const char *login_executable;
132N/A const char *login_user;
132N/A const char *login_greeting;
132N/A const char *login_log_format_elements;
132N/A const char *login_log_format;
132N/A
132N/A bool login_process_per_connection;
132N/A bool login_chroot;
132N/A bool login_greeting_capability;
132N/A
132N/A unsigned int login_process_size;
132N/A unsigned int login_processes_count;
132N/A unsigned int login_max_processes_count;
132N/A unsigned int login_max_connections;
132N/A
132N/A /* mail */
132N/A const char *valid_chroot_dirs;
132N/A const char *mail_chroot;
132N/A unsigned int max_mail_processes;
132N/A unsigned int mail_max_userip_connections;
132N/A bool verbose_proctitle;
132N/A
132N/A unsigned int first_valid_uid, last_valid_uid;
132N/A unsigned int first_valid_gid, last_valid_gid;
132N/A const char *mail_extra_groups;
132N/A const char *mail_uid;
132N/A const char *mail_gid;
132N/A
132N/A const char *default_mail_env;
132N/A const char *mail_location;
132N/A const char *mail_cache_fields;
132N/A const char *mail_never_cache_fields;
132N/A unsigned int mail_cache_min_mail_count;
132N/A unsigned int mailbox_idle_check_interval;
132N/A bool mail_debug;
132N/A bool mail_full_filesystem_access;
132N/A unsigned int mail_max_keyword_length;
132N/A bool mail_save_crlf;
132N/A bool mmap_disable;
132N/A bool dotlock_use_excl;
132N/A bool fsync_disable;
132N/A bool mail_nfs_storage;
132N/A bool mail_nfs_index;
132N/A bool mailbox_list_index_disable;
132N/A const char *lock_method;
132N/A bool maildir_stat_dirs;
132N/A bool maildir_copy_with_hardlinks;
132N/A bool maildir_copy_preserve_filename;
132N/A const char *mbox_read_locks;
132N/A const char *mbox_write_locks;
132N/A unsigned int mbox_lock_timeout;
132N/A unsigned int mbox_dotlock_change_timeout;
132N/A unsigned int mbox_min_index_size;
132N/A bool mbox_dirty_syncs;
132N/A bool mbox_very_dirty_syncs;
132N/A bool mbox_lazy_writes;
132N/A unsigned int dbox_rotate_size;
132N/A unsigned int dbox_rotate_min_size;
132N/A unsigned int dbox_rotate_days;
132N/A unsigned int umask;
132N/A bool mail_drop_priv_before_exec;
132N/A
132N/A const char *mail_executable;
132N/A unsigned int mail_process_size;
132N/A const char *mail_plugins;
132N/A const char *mail_plugin_dir;
144N/A const char *mail_log_prefix;
144N/A unsigned int mail_log_max_lines_per_sec;
144N/A
144N/A /* imap */
144N/A unsigned int imap_max_line_length;
177N/A const char *imap_capability;
144N/A const char *imap_client_workarounds;
144N/A const char *imap_logout_format;
132N/A
/* pop3 */
bool pop3_no_flag_updates;
bool pop3_enable_last;
bool pop3_reuse_xuidl;
bool pop3_lock_session;
const char *pop3_uidl_format;
const char *pop3_client_workarounds;
const char *pop3_logout_format;
/* .. */
ARRAY_TYPE(listener) listens;
ARRAY_TYPE(listener) ssl_listens;
uid_t login_uid, mail_uid_t;
gid_t mail_gid_t;
const char *imap_generated_capability;
ARRAY_DEFINE(plugin_envs, const char *);
};
struct socket_settings {
const char *path;
unsigned int mode;
const char *user;
const char *group;
unsigned int used:1;
};
struct auth_socket_settings {
struct auth_settings *parent;
struct auth_socket_settings *next;
const char *type;
struct socket_settings master;
struct socket_settings client;
};
struct auth_passdb_settings {
struct auth_settings *parent;
struct auth_passdb_settings *next;
const char *driver;
const char *args;
bool deny;
bool pass;
bool master;
};
struct auth_userdb_settings {
struct auth_settings *parent;
struct auth_userdb_settings *next;
const char *driver;
const char *args;
};
struct auth_settings {
struct server_settings *parent;
struct auth_settings *next;
const char *name;
const char *mechanisms;
const char *realms;
const char *default_realm;
unsigned int cache_size;
unsigned int cache_ttl;
unsigned int cache_negative_ttl;
const char *executable;
const char *user;
const char *chroot;
const char *username_chars;
const char *username_translation;
const char *username_format;
const char *master_user_separator;
const char *anonymous_username;
const char *krb5_keytab;
const char *gssapi_hostname;
const char *winbind_helper_path;
bool verbose, debug, debug_passwords;
bool ssl_require_client_cert;
bool ssl_username_from_cert;
bool ntlm_use_winbind;
unsigned int count;
unsigned int worker_max_count;
unsigned int worker_max_request_count;
unsigned int process_size;
/* .. */
uid_t uid;
gid_t gid;
struct auth_passdb_settings *passdbs;
struct auth_userdb_settings *userdbs;
struct auth_socket_settings *sockets;
};
struct namespace_settings {
struct server_settings *parent;
struct namespace_settings *next;
const char *type;
const char *separator;
const char *prefix;
const char *location;
bool inbox;
bool hidden;
bool list;
};
struct server_settings {
struct server_settings *next;
const char *name;
struct settings *defaults;
struct settings *imap;
struct settings *pop3;
struct auth_settings *auths;
struct auth_settings auth_defaults;
struct namespace_settings *namespaces;
ARRAY_DEFINE(dicts, const char *);
gid_t login_gid;
};
extern struct server_settings *settings_root;
bool master_settings_read(const char *path, bool nochecks, bool nofixes);
void master_settings_dump(struct server_settings *set, bool nondefaults);
void master_settings_init(void);
void master_settings_deinit(void);
#endif