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;
{
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;