[exim-cvs] cvs commit: exim/exim-doc/doc-txt NewStuff exim/…

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: exim-cvs
Assumpte: [exim-cvs] cvs commit: exim/exim-doc/doc-txt NewStuff exim/exim-src/src verify.c exim/exim-src/src/lookups dnsdb.c exim/exim-test-orig/AutoTest/scripts 082 exim/exim-test-orig/AutoTest/stdout 082
ph10 2004/11/25 14:31:28 GMT

  Modified files:
    exim-doc/doc-txt     NewStuff 
    exim-src/src         verify.c 
    exim-src/src/lookups dnsdb.c 
    exim-test-orig/AutoTest/scripts 082 
    exim-test-orig/AutoTest/stdout 082 
  Log:
  Don't defer for lists of domains (in dnsdb and dnslists sublists) if any
  of the other items is actually found.


  Revision  Changes    Path
  1.19      +9 -4      exim/exim-doc/doc-txt/NewStuff
  1.5       +9 -3      exim/exim-src/src/lookups/dnsdb.c
  1.8       +8 -1      exim/exim-src/src/verify.c
  1.8       +1 -0      exim/exim-test-orig/AutoTest/scripts/082
  1.8       +2 -0      exim/exim-test-orig/AutoTest/stdout/082


  Index: NewStuff
  ===================================================================
  RCS file: /home/cvs/exim/exim-doc/doc-txt/NewStuff,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- NewStuff    25 Nov 2004 13:54:31 -0000    1.18
  +++ NewStuff    25 Nov 2004 14:31:28 -0000    1.19
  @@ -1,4 +1,4 @@
  -$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.18 2004/11/25 13:54:31 ph10 Exp $
  +$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.19 2004/11/25 14:31:28 ph10 Exp $


   New Features in Exim
   --------------------
  @@ -151,9 +151,10 @@
       default - see 14 below), in the same way that multiple DNS records for a
       single item are handled.


  -    The lookup fails only if all the DNS lookups fail. As long as at least one
  -    of them yields some data, the lookup succeeds. However, if there is a
  -    temporary DNS error for any of them, the lookup defers.
  +    The dnsdb lookup fails only if all the DNS lookups fail. If there is a
  +    temporary DNS error for any of them, the remaining lookups are still done,
  +    and only if none of them succeed does the dnsdb lookup defer. As long as at
  +    least one of the DNS lookups yields some data, the dnsdb lookup succeeds.


   15. It is now possible to specify the character to be used as a separator when
       a dnsdb lookup returns data from more than one DNS record. The default is a
  @@ -198,7 +199,11 @@
          2.1.168.192.black.list.tld  and  a.domain.black.list.tld


       Once a DNS record has been found (that matches a specific IP return
  -    address, if specified), no further lookups are done.
  +    address, if specified), no further lookups are done. If there is a
  +    temporary DNS error, the rest of the sublist of domains or IP addresses is
  +    tried. The dnslists item itself defers only if none of the other DNS
  +    lookups in this sublist succeeds. In other words, a successful lookup for
  +    any of the items in the sublist overrides a defer for a previous item.


   17. The log selector queue_time_overall causes Exim to output the time spent on
       the queue as an addition to the "Completed" message. Like queue_time (which


  Index: verify.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/verify.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- verify.c    22 Nov 2004 11:30:04 -0000    1.7
  +++ verify.c    25 Nov 2004 14:31:28 -0000    1.8
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/verify.c,v 1.7 2004/11/22 11:30:04 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/verify.c,v 1.8 2004/11/25 14:31:28 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -2593,6 +2593,7 @@
     else
       {
       int keysep = 0;
  +    BOOL defer = FALSE; 
       uschar *keydomain; 
       uschar keybuffer[256];


  @@ -2625,11 +2626,17 @@
           dnslist_domain = string_copy(domain);
           HDEBUG(D_dnsbl) debug_printf("=> that means %s is listed at %s\n", 
             keydomain, domain);
  +        return OK;   
           }


  -      if (rc != FAIL) return rc;   /* OK or DEFER */
  +      /* If the lookup deferred, remember this fact. We keep trying the rest
  +      of the list to see if we get a useful result, and if we don't, we return
  +      DEFER at the end. */


  +      if (rc == DEFER) defer = TRUE;
         }    /* continue with next keystring domain/address */
  +
  +    if (defer) return DEFER;
       }  
     }        /* continue with next dnsdb outer domain */



  Index: dnsdb.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/lookups/dnsdb.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- dnsdb.c    24 Nov 2004 15:43:36 -0000    1.4
  +++ dnsdb.c    25 Nov 2004 14:31:28 -0000    1.5
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/lookups/dnsdb.c,v 1.4 2004/11/24 15:43:36 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/lookups/dnsdb.c,v 1.5 2004/11/25 14:31:28 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -103,6 +103,7 @@
   int ptr = 0;
   int sep = 0;
   int type = T_TXT;
  +int failrc = FAIL;
   uschar *outsep = US"\n";
   uschar *equals, *domain;
   uschar buffer[256];
  @@ -205,12 +206,17 @@
     lookup function so that the facility could be used from other parts of the
     Exim code. The latter affects only what happens later on in this function,
     but for tidiness it is handled in a similar way. If the lookup fails,
  -  continue with the next domain. */
  +  continue with the next domain. In the case of DEFER, adjust the final 
  +  "nothing found" result, but carry on to the next domain. */


     rc = dns_special_lookup(&dnsa, domain, type, NULL);


     if (rc == DNS_NOMATCH || rc == DNS_NODATA) continue;
  -  if (rc != DNS_SUCCEED) return DEFER;
  +  if (rc != DNS_SUCCEED)
  +    {
  +    failrc = DEFER;
  +    continue;
  +    }


     /* Search the returned records */


@@ -301,7 +307,7 @@
/* If ptr == 0 we have not found anything. Otherwise, insert the terminating
zero and return the result. */

-if (ptr == 0) return FAIL;
+if (ptr == 0) return failrc;
yield[ptr] = 0;
*result = yield;
return OK;

  Index: 082
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/scripts/082,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- 082    24 Nov 2004 15:43:36 -0000    1.7
  +++ 082    25 Nov 2004 14:31:28 -0000    1.8
  @@ -450,6 +450,7 @@
   # DNS lookups with multiple items


   ten-1:ten2                 ${lookup dnsdb{a=ten-1.test.ex:ten-2.test.ex}}
  +ten-1:defer:ten2           ${lookup dnsdb{a=ten-1.test.ex:test.again.dns:ten-2.test.ex}}
   ten-1|ten2                 ${lookup dnsdb{a=<|ten-1.test.ex|ten-2.test.ex}}
   mxt1;mxt2 | output         ${lookup dnsdb{>|mx=<;mxt1.test.ex;mxt2.test.ex}}
   mxt1;mxt2 | output         ${lookup dnsdb{>|mxh=<;mxt1.test.ex;mxt2.test.ex}}


  Index: 082
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/082,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- 082    24 Nov 2004 15:43:36 -0000    1.7
  +++ 082    25 Nov 2004 14:31:28 -0000    1.8
  @@ -447,6 +447,8 @@

>
   > ten-1:ten2                 10.0.0.1
   10.0.0.2
  +> ten-1:defer:ten2           10.0.0.1
  +10.0.0.2
   > ten-1|ten2                 10.0.0.1
   10.0.0.2
   > mxt1;mxt2 | output         5 xoanon.csi.cam.ac.uk|5 not-exist.test.ex