X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Flookups%2Fdnsdb.c;h=70e6c8c637586a3bafea0815104be05ad63be60c;hb=3a2ac12bcabf06f73ef372dfa23e6edead237aa7;hp=2e6805dc900c196be989610d88c098992f47b496;hpb=fc362fc531e0ffc898c784e09f097327f5814289;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/lookups/dnsdb.c b/src/src/lookups/dnsdb.c index 2e6805dc9..70e6c8c63 100644 --- a/src/src/lookups/dnsdb.c +++ b/src/src/lookups/dnsdb.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2014 */ +/* Copyright (c) University of Cambridge 1995 - 2015 */ /* See the file NOTICE for conditions of use and distribution. */ #include "../exim.h" @@ -131,7 +131,7 @@ separator, as always, is colon. */ static int dnsdb_find(void *handle, uschar *filename, const uschar *keystring, int length, - uschar **result, uschar **errmsg, BOOL *do_cache) + uschar **result, uschar **errmsg, uint *do_cache) { int rc; int size = 256; @@ -388,10 +388,13 @@ while ((domain = string_nextinlist(&keystring, &sep, NULL, 0))) { if (rr->type != searchtype) continue; + if (*do_cache > rr->ttl) + *do_cache = rr->ttl; + if (type == T_A || type == T_AAAA || type == T_ADDRESSES) { dns_address *da; - for (da = dns_address_from_rr(&dnsa, rr); da != NULL; da = da->next) + for (da = dns_address_from_rr(&dnsa, rr); da; da = da->next) { if (ptr != 0) yield = string_cat(yield, &size, &ptr, outsep, 1); yield = string_cat(yield, &size, &ptr, da->address,