Support dnssec in verify-callout use of smtp transport.
authorJeremy Harris <jgh146exb@wizmail.org>
Thu, 1 May 2014 22:26:14 +0000 (23:26 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Thu, 1 May 2014 22:26:14 +0000 (23:26 +0100)
Use of dnslookup router support is already present.

src/src/host.c
src/src/lookups/dnsdb.c
src/src/verify.c

index 05bcbe8c77d42d1c5fb2f1104e4d14babd0f5d0a..a1db7717e5624fe5315dd716d1de9e4eccc4abb0 100644 (file)
@@ -1624,7 +1624,7 @@ while ((ordername = string_nextinlist(&list, &sep, buffer, sizeof(buffer)))
   {
   if (strcmpic(ordername, US"bydns") == 0)
     {
   {
   if (strcmpic(ordername, US"bydns") == 0)
     {
-    dns_init(FALSE, FALSE, FALSE);     /*XXX dnssec? */
+    dns_init(FALSE, FALSE, FALSE);    /* dnssec ctrl by dns_dnssec_ok glbl */
     dns_build_reverse(sender_host_address, buffer);
     rc = dns_lookup(&dnsa, buffer, T_PTR, NULL);
 
     dns_build_reverse(sender_host_address, buffer);
     rc = dns_lookup(&dnsa, buffer, T_PTR, NULL);
 
index ef3376505c504793295cbe366acdc3ed82fd38a7..5c077fb3151c4e32287ca9a8d9f5edd6baf536f1 100644 (file)
@@ -362,7 +362,7 @@ while ((domain = string_nextinlist(&keystring, &sep, buffer, sizeof(buffer)))
       {
       if (defer_mode == DEFER)
        {
       {
       if (defer_mode == DEFER)
        {
-       dns_init(FALSE, FALSE, FALSE);
+       dns_init(FALSE, FALSE, FALSE);                  /* clr dnssec bit */
        return DEFER;                                   /* always defer */
        }
       if (defer_mode == PASS) failrc = DEFER;         /* defer only if all do */
        return DEFER;                                   /* always defer */
        }
       if (defer_mode == PASS) failrc = DEFER;         /* defer only if all do */
index f799ff1debc620e18115fa7ff2547da566417a40..c5ffdae4e7d9a4045f594c1453b4f8dd47d23bbb 100644 (file)
@@ -379,7 +379,7 @@ else if (Ustrcmp(addr->transport->driver_name, "smtp") != 0)
 else
   {
   smtp_transport_options_block *ob =
 else
   {
   smtp_transport_options_block *ob =
-    (smtp_transport_options_block *)(addr->transport->options_block);
+    (smtp_transport_options_block *)addr->transport->options_block;
 
   /* The information wasn't available in the cache, so we have to do a real
   callout and save the result in the cache for next time, unless no_cache is set,
 
   /* The information wasn't available in the cache, so we have to do a real
   callout and save the result in the cache for next time, unless no_cache is set,
@@ -1749,9 +1749,20 @@ while (addr_new != NULL)
                   string_is_ip_address(host->name, NULL) != 0)
                 (void)host_find_byname(host, NULL, flags, &canonical_name, TRUE);
               else
                   string_is_ip_address(host->name, NULL) != 0)
                 (void)host_find_byname(host, NULL, flags, &canonical_name, TRUE);
               else
+               {
+               uschar * d_request = NULL, * d_require = NULL;
+               if (Ustrcmp(addr->transport->driver_name, "smtp") == 0)
+                 {
+                 smtp_transport_options_block * ob =
+                     (smtp_transport_options_block *)
+                       addr->transport->options_block;
+                 d_request = ob->dnssec_request_domains;
+                 d_require = ob->dnssec_require_domains;
+                 }
+
                 (void)host_find_bydns(host, NULL, flags, NULL, NULL, NULL,
                 (void)host_find_bydns(host, NULL, flags, NULL, NULL, NULL,
-                 NULL, NULL,   /*XXX todo: dnssec */
-                  &canonical_name, NULL);
+                 d_request, d_require, &canonical_name, NULL);
+               }
               }
             }
           }
               }
             }
           }