diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 52 |
1 files changed, 37 insertions, 15 deletions
@@ -37,6 +37,7 @@ #include <mailutils/server.h> #include <mailutils/syslog.h> #include <mailutils/libargp.h> +#include <mailutils/dbm.h> #include "mailfromd.h" #include "callout.h" @@ -44,7 +45,6 @@ #include "inttostr.h" #include "srvcfg.h" #include "filenames.h" -#include "mf-dbm.h" #include "builtin.h" #include "prog.h" @@ -918,11 +918,10 @@ struct mu_cfg_param mf_cfg_param[] = { { "database", mu_cfg_section, NULL }, - { "lock-retry-count", mu_cfg_size, &lock_retry_count_option, 0, NULL, - N_("Retry acquiring DBM file lock this number of times.") }, - { "lock-retry-timeout", mu_cfg_callback, &lock_retry_timeout_option, 0, - config_cb_time_t, - N_("Set the time span between the two DBM locking attempts."), + { "lock-retry-count", mu_cfg_callback, 0, 0, config_cb_ignore, + N_("Ignored for backward compatibility.") }, + { "lock-retry-timeout", mu_cfg_callback, 0,0, config_cb_ignore, + N_("Ignored for backward compatibility."), N_("time") }, { "max-match-mx", mu_cfg_size, &max_match_mx, 0, NULL, @@ -1003,6 +1002,37 @@ db_format_enumerator(struct db_format *fmt, void *data) return 0; } +static void +list_db_formats(const char *pfx) +{ + mu_iterator_t itr; + int rc; + const char *defdb = DEFAULT_DB_TYPE; + printf("%s", pfx); + + rc = mu_dbm_impl_iterator(&itr); + if (rc) { + printf("%s\n", _("unknown")); + mu_error("%s", mu_strerror(rc)); + } else { + int i; + for (mu_iterator_first(itr), i = 0; !mu_iterator_is_done(itr); + mu_iterator_next(itr), i++) { + struct mu_dbm_impl *impl; + + mu_iterator_current(itr, (void**)&impl); + if (i) + printf(", "); + else if (!defdb) + defdb = impl->_dbm_name; + printf("%s", impl->_dbm_name); + } + putchar('\n'); + mu_iterator_destroy(&itr); + } + printf("default database type: %s\n", defdb); +} + void mailfromd_show_defaults() { @@ -1020,14 +1050,7 @@ mailfromd_show_defaults() printf("default syslog: blocking\n"); #endif #endif - printf("database format: "); -#if defined WITH_GDBM - printf("GDBM"); -#elif defined WITH_BDB - printf("Berkeley DB %d.x", WITH_BDB); -#endif - printf("\n"); - + list_db_formats("supported databases: "); printf("Optional features: "); #if defined WITH_GEOIP printf(" GeoIP"); @@ -1193,7 +1216,6 @@ main(int argc, char **argv) init_symbols(); builtin_setup(); mf_runtime_param_finish(); - libdbm_init(); db_format_setup(); include_path_setup(); pragma_setup(); |