summaryrefslogtreecommitdiffabout
path: root/src/main.c
Side-by-side diff
Diffstat (limited to 'src/main.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/main.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c
index c277aa4..ba0c0f5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -34,20 +34,20 @@
#include <netdb.h>
#include <mailutils/mailutils.h>
#include <mailutils/server.h>
#include <mailutils/syslog.h>
#include <mailutils/libargp.h>
+#include <mailutils/dbm.h>
#include "mailfromd.h"
#include "callout.h"
#include "srvman.h"
#include "inttostr.h"
#include "srvcfg.h"
#include "filenames.h"
-#include "mf-dbm.h"
#include "builtin.h"
#include "prog.h"
/* Configurable options */
@@ -915,17 +915,16 @@ struct mu_cfg_param mf_cfg_param[] = {
cb_relayed_domain_file,
N_("Read relayed domain names from the file"),
N_("file: string") },
{ "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,
N_("Maximum number of MXs used by MFL \"mx match\" operation.") },
{ "runtime", mu_cfg_section, NULL },
@@ -1000,12 +999,43 @@ db_format_enumerator(struct db_format *fmt, void *data)
} else
printf("%s expiration: %lu\n", fmt->name,
fmt->expire_interval);
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()
{
printf("version: %s\n", VERSION);
printf("script file: %s\n", script_file);
printf("preprocessor: %s\n", ext_pp ? ext_pp : "none");
@@ -1017,20 +1047,13 @@ mailfromd_show_defaults()
#if DEFAULT_SYSLOG_ASYNC == 1
printf("default syslog: non-blocking\n");
#else
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");
#endif
#if defined WITH_DSPAM
printf(" DSPAM");
@@ -1190,13 +1213,12 @@ main(int argc, char **argv)
debug_init(modnames);
libcallout_init();
init_string_space();
init_symbols();
builtin_setup();
mf_runtime_param_finish();
- libdbm_init();
db_format_setup();
include_path_setup();
pragma_setup();
mf_optcache_add(option_cache, 0, MF_OCF_NULL|MF_OCF_STATIC);
mf_server_save_cmdline(argc, argv);

Return to:

Send suggestions and report system problems to the System administrator.