summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org.ua>2017-11-02 10:58:58 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2017-11-02 10:58:58 (GMT)
commitf127def749e7e49e55fb212aecf10594613f337e (patch) (side-by-side diff)
tree09511e8cb652442a20d3861a43d98c5cb4f19d82 /src
parent520ca3e09a517af45b73b37075cc3a87dc966eb5 (diff)
downloadmailfromd-f127def749e7e49e55fb212aecf10594613f337e.tar.gz
mailfromd-f127def749e7e49e55fb212aecf10594613f337e.tar.bz2
calloutd: implement the --resolv-conf-file option
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/calloutd.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/calloutd.c b/src/calloutd.c
index 56dd2a4..1f25649 100644
--- a/src/calloutd.c
+++ b/src/calloutd.c
@@ -48,6 +48,8 @@ callout_alloc_die()
const char *program_version = "calloutd (" PACKAGE_STRING ")";
static char prog_doc[] = N_("calloutd -- a call out server");
+static char *resolv_conf_file;
+
struct mu_cfg_param callout_cfg_param[] = {
{ ".mfd:server", mu_cfg_section, NULL, 0, NULL, NULL },
{ "lock-retry-count", mu_cfg_callback, NULL, 0,
@@ -57,8 +59,7 @@ struct mu_cfg_param callout_cfg_param[] = {
{ "lock-retry-timeout", mu_cfg_callback, NULL, 0,
config_cb_lock_retry_timeout,
N_("Set the time span between the two DBM locking attempts."),
- N_("time: interval") },
-
+ N_("time: interval") },
{ NULL }
};
@@ -81,7 +82,16 @@ mf_server_function(const char *key, struct mf_srvcfg *cfg)
return 0;
}
+static struct mu_option calloutd_options[] = {
+ MU_OPTION_GROUP(N_("General options")),
+ { "resolv-conf-file", 0, N_("FILE"), MU_OPTION_DEFAULT,
+ N_("read resolver configuration from FILE"),
+ mu_c_string, &resolv_conf_file },
+ MU_OPTION_END
+}, *options[] = { calloutd_options, NULL };
+
struct mu_cli_setup cli = {
+ .optv = options,
.cfg = callout_cfg_param,
.prog_doc = prog_doc,
};
@@ -108,6 +118,9 @@ main(int argc, char **argv)
mf_srvcfg_init(argv[0], NULL);
mf_getopt(&cli, &argc, &argv, capa, MF_GETOPT_DEFAULT);
+ if (resolv_conf_file)
+ dnsbase_file_init(resolv_conf_file);
+
mf_srvcfg_flush();
mf_server_lint_option = "--config-lint";

Return to:

Send suggestions and report system problems to the System administrator.