diff options
Diffstat (limited to 'src/srvcfg.c')
-rw-r--r-- | src/srvcfg.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/srvcfg.c b/src/srvcfg.c index 0afb7f6a..4030a4e6 100644 --- a/src/srvcfg.c +++ b/src/srvcfg.c @@ -18,12 +18,13 @@ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <mailutils/mailutils.h> #include <mailutils/libargp.h> +#include <mailutils/dbm.h> #include <argp.h> #include <sysexits.h> #include "xalloc.h" #include "inttostr.h" #include "libmf.h" @@ -38,12 +39,13 @@ int server_flags = 0; char *log_stream = DEFAULT_LOG_STREAM; char *pidfile; int smtp_transcript; static int transcript_option; struct mu_sockaddr *source_address; /* Source address for TCP connections */ int mtasim_option; /* mtasim compatibility mode */ +char *db_type_str = DEFAULT_DB_TYPE; size_t max_callout_mx = MAXMXCOUNT; /* Timeouts */ time_t smtp_timeout_soft[SMTP_NUM_TIMEOUT] = { 10, @@ -611,12 +613,15 @@ static struct mu_cfg_param srv_cfg_param[] = { { "max-callout-mx", mu_cfg_size, &max_callout_mx, 0, NULL, N_("Maximum number of MXs to be polled during " "callout verification.") }, { "state-directory", mu_cfg_callback, NULL, 0, cb_state_directory, N_("Set program state directory."), N_("dir") }, + { "database-type", mu_cfg_string, &db_type_str, 0, NULL, + N_("Default database type"), + N_("type") }, { "database", mu_cfg_section, NULL, 0, NULL, NULL }, { "ehlo-domain", mu_cfg_string, &ehlo_domain, 0, NULL, N_("Set the domain name for EHLO command.") }, { "mail-from-address", mu_cfg_string, &mailfrom_address, 0, NULL, N_("Set email address for use in SMTP `MAIL FROM' command. " "Argument is an email address or a comma-separated list of " @@ -858,12 +863,26 @@ mf_srvcfg_flush() if (smtp_timeout_hard[i] == 0) smtp_timeout_hard[i] = io_timeout; } if (!ehlo_domain) init_ehlo_domain(); + + if (db_type_str) { + mu_url_t dbhint; + int rc; + + if ((rc = mu_url_create_null(&dbhint)) || + (rc = mu_url_set_scheme(dbhint, db_type_str))) { + mu_error(_("cannot initialize DBM hint: %s"), + mu_strerror(rc)); + exit(EX_SOFTWARE); + } + mu_url_destroy(&mu_dbm_hint); + mu_dbm_hint = dbhint; + } } void mf_srvcfg_log_setup(char *stream) { if (logger_select(stream)) { |