aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-10-23 20:50:09 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2017-10-23 20:50:09 +0300
commit368a705fe49cc31857c08e357d42314b3d54b2b5 (patch)
treedbe8071907c0908737c42ca0d1566efbbbd21f58 /src/main.c
parent2f77b90a2d1e7a43f7d77f06c953142cb90146f4 (diff)
downloadmailfromd-368a705fe49cc31857c08e357d42314b3d54b2b5.tar.gz
mailfromd-368a705fe49cc31857c08e357d42314b3d54b2b5.tar.bz2
Improve DNS API; rewrite DNS testsuite.
* lib/dns.c (dnsbase_real_init): Take configuration text as argument (can be NULL). Enable adns debugging on trace9 (dnsbase_file_init): New function. (dns_reply_init): New function. (dns_reply_push): New function. (soa_check): New function. Rewrite all functions using dns_reply_init+dns_reply_push, as appropriate. * lib/dns.h (dns_reply) <maxcount, data.ptr>: New members. (dnsbase_real_init, dnsbase_file_init) (dns_reply_init, soa_check): New protos. * src/builtin/dns.bi (resolve_host): Rewrite to return all A records. (dns_replies_intersect): New static function. (primitive_ismx): Rewrite taking into account all A records. * src/main.c: New option --resolv-conf-file (mostly for checking. * tests/resolv.c: Change option handling, implement new options. * tests/atlocal.in (MF_TOPDOMAIN,MF_NAMESERVER): New variables. (at_resolv_conf): New function. * tests/Makefile.am: Add new tests. * tests/testsuite.at: Include new tests. * tests/hasmx.at: Use dedicated MF test domains, * tests/hostname.at: Likewise. * tests/ismx.at: Likewise. * tests/rescname.at: Likewise. * tests/resolve.at: Likewise. * tests/resolv_a.at: New test. * tests/resolv_mx.at: Likewise. * tests/resolv_ptr.at: Likewise. * tests/resolv_ptr_val.at: Likewise. * tests/resolv_spf.at: Likewise. * tests/resolv_txt.at: Likewise.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 9873ed0f..dcc7d432 100644
--- a/src/main.c
+++ b/src/main.c
@@ -84,2 +84,4 @@ static int trace_option = ARG_UNSET;
static mu_list_t trace_modules;
+
+static char *resolv_conf_file;
@@ -565,2 +567,5 @@ static struct mu_option mailfromd_options[] = {
mu_c_string, NULL, opt_relayed_domain_file },
+ { "resolv-conf-file", 0, N_("FILE"), MU_OPTION_DEFAULT,
+ N_("read resolver configuration from FILE"),
+ mu_c_string, &resolv_conf_file },
@@ -1271,3 +1276,5 @@ main(int argc, char **argv)
init_relayed_domains();
-
+ if (resolv_conf_file)
+ dnsbase_file_init(resolv_conf_file);
+
if (trace_option != ARG_UNSET)

Return to:

Send suggestions and report system problems to the System administrator.