Fix taint-handling in rDNS name construction
[exim.git] / src / src / lookups / dnsdb.c
CommitLineData
0756eb3c
PH
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
f9ba5e22 5/* Copyright (c) University of Cambridge 1995 - 2018 */
0756eb3c
PH
6/* See the file NOTICE for conditions of use and distribution. */
7
8#include "../exim.h"
9#include "lf_functions.h"
0756eb3c
PH
10
11
12
13/* Ancient systems (e.g. SunOS4) don't appear to have T_TXT defined in their
14header files. */
15
16#ifndef T_TXT
acec9514 17# define T_TXT 16
0756eb3c
PH
18#endif
19
eae0036b
PP
20/* Many systems do not have T_SPF. */
21#ifndef T_SPF
acec9514 22# define T_SPF 99
eae0036b
PP
23#endif
24
1e06383a
TL
25/* New TLSA record for DANE */
26#ifndef T_TLSA
acec9514 27# define T_TLSA 52
1e06383a
TL
28#endif
29
0756eb3c
PH
30/* Table of recognized DNS record types and their integer values. */
31
1ba28e2b 32static const char *type_names[] = {
0756eb3c
PH
33 "a",
34#if HAVE_IPV6
3a796370 35 "a+",
0756eb3c 36 "aaaa",
0756eb3c
PH
37#endif
38 "cname",
e5a9dba6 39 "csa",
0756eb3c 40 "mx",
ea3bc19b 41 "mxh",
0756eb3c
PH
42 "ns",
43 "ptr",
d2a2c69b 44 "soa",
eae0036b 45 "spf",
0756eb3c 46 "srv",
1e06383a 47 "tlsa",
33397d19 48 "txt",
8e669ac1 49 "zns"
33397d19 50};
0756eb3c
PH
51
52static int type_values[] = {
53 T_A,
54#if HAVE_IPV6
66be95e0 55 T_ADDRESSES, /* Private type for AAAA + A */
0756eb3c 56 T_AAAA,
0756eb3c
PH
57#endif
58 T_CNAME,
e5a9dba6 59 T_CSA, /* Private type for "Client SMTP Authorization". */
0756eb3c 60 T_MX,
ea3bc19b 61 T_MXH, /* Private type for "MX hostnames" */
0756eb3c
PH
62 T_NS,
63 T_PTR,
d2a2c69b 64 T_SOA,
eae0036b 65 T_SPF,
0756eb3c 66 T_SRV,
1e06383a 67 T_TLSA,
33397d19
PH
68 T_TXT,
69 T_ZNS /* Private type for "zone nameservers" */
70};
0756eb3c
PH
71
72
73/*************************************************
74* Open entry point *
75*************************************************/
76
77/* See local README for interface description. */
78
e6d225ae 79static void *
0756eb3c
PH
80dnsdb_open(uschar *filename, uschar **errmsg)
81{
82filename = filename; /* Keep picky compilers happy */
83errmsg = errmsg; /* Ditto */
84return (void *)(-1); /* Any non-0 value */
85}
86
87
88
89/*************************************************
90* Find entry point for dnsdb *
91*************************************************/
92
7bb56e1f
PH
93/* See local README for interface description. The query in the "keystring" may
94consist of a number of parts.
95
8e669ac1
PH
96(a) If the first significant character is '>' then the next character is the
97separator character that is used when multiple records are found. The default
7bb56e1f
PH
98separator is newline.
99
0d0c6357
NM
100(b) If the next character is ',' then the next character is the separator
101character used for multiple items of text in "TXT" records. Alternatively,
102if the next character is ';' then these multiple items are concatenated with
103no separator. With neither of these options specified, only the first item
8ee4b30e
PP
104is output. Similarly for "SPF" records, but the default for joining multiple
105items in one SPF record is the empty string, for direct concatenation.
0d0c6357 106
fd7f7910
JH
107(c) Options, all comma-terminated, in any order. Any unrecognised option
108terminates option processing. Recognised options are:
109
110- 'defer_FOO': set the defer behaviour to FOO. The possible behaviours are:
111'strict', where any defer causes the whole lookup to defer; 'lax', where a defer
112causes the whole lookup to defer only if none of the DNS queries succeeds; and
113'never', where all defers are as if the lookup failed. The default is 'lax'.
114
ab0e957b 115- 'dnssec_FOO', with 'strict', 'lax' (default), and 'never'. The meanings are
fd3b6a4a
JH
116require, try and don't-try dnssec respectively.
117
fd7f7910
JH
118- 'retrans_VAL', set the timeout value. VAL is an Exim time specification
119(eg "5s"). The default is set by the main configuration option 'dns_retrans'.
120
121- 'retry_VAL', set the retry count on timeouts. VAL is an integer. The
122default is set by the main configuration option "dns_retry".
123
124(d) If the next sequence of characters is a sequence of letters and digits
8e669ac1 125followed by '=', it is interpreted as the name of the DNS record type. The
ff4dbb19 126default is "TXT".
7bb56e1f 127
fd7f7910 128(e) Then there follows list of domain names. This is a generalized Exim list,
8e669ac1 129which may start with '<' in order to set a specific separator. The default
7bb56e1f 130separator, as always, is colon. */
0756eb3c 131
e6d225ae 132static int
55414b25 133dnsdb_find(void *handle, uschar *filename, const uschar *keystring, int length,
14b3c5bc 134 uschar **result, uschar **errmsg, uint *do_cache)
0756eb3c
PH
135{
136int rc;
7bb56e1f 137int sep = 0;
ff4dbb19 138int defer_mode = PASS;
ab0e957b 139int dnssec_mode = PASS;
fd7f7910
JH
140int save_retrans = dns_retrans;
141int save_retry = dns_retry;
542bc632 142int type;
c38d6da9 143int failrc = FAIL;
55414b25
JH
144const uschar *outsep = CUS"\n";
145const uschar *outsep2 = NULL;
e5a9dba6 146uschar *equals, *domain, *found;
0756eb3c 147
8743d3ac
JH
148dns_answer * dnsa = store_get_dns_answer();
149dns_scan dnss;
150
acec9514 151/* Because we're working in the search pool, we try to reclaim as much
0756eb3c
PH
152store as possible later, so we preallocate the result here */
153
acec9514 154gstring * yield = string_get(256);
0756eb3c 155
0756eb3c
PH
156handle = handle; /* Keep picky compilers happy */
157filename = filename;
158length = length;
159do_cache = do_cache;
160
0d0c6357
NM
161/* If the string starts with '>' we change the output separator.
162If it's followed by ';' or ',' we set the TXT output separator. */
0756eb3c 163
7bb56e1f
PH
164while (isspace(*keystring)) keystring++;
165if (*keystring == '>')
0756eb3c 166 {
7bb56e1f 167 outsep = keystring + 1;
8e669ac1 168 keystring += 2;
0d0c6357
NM
169 if (*keystring == ',')
170 {
171 outsep2 = keystring + 1;
172 keystring += 2;
173 }
174 else if (*keystring == ';')
175 {
176 outsep2 = US"";
177 keystring++;
178 }
7bb56e1f 179 while (isspace(*keystring)) keystring++;
8e669ac1 180 }
7bb56e1f 181
fd3b6a4a 182/* Check for a modifier keyword. */
ff4dbb19 183
fd7f7910 184for (;;)
ff4dbb19 185 {
fd3b6a4a 186 if (strncmpic(keystring, US"defer_", 6) == 0)
ff4dbb19 187 {
ff4dbb19 188 keystring += 6;
fd3b6a4a 189 if (strncmpic(keystring, US"strict", 6) == 0)
fd7f7910 190 { defer_mode = DEFER; keystring += 6; }
fd3b6a4a 191 else if (strncmpic(keystring, US"lax", 3) == 0)
fd7f7910 192 { defer_mode = PASS; keystring += 3; }
fd3b6a4a 193 else if (strncmpic(keystring, US"never", 5) == 0)
fd7f7910 194 { defer_mode = OK; keystring += 5; }
fd3b6a4a
JH
195 else
196 {
197 *errmsg = US"unsupported dnsdb defer behaviour";
198 return DEFER;
199 }
ff4dbb19 200 }
fd7f7910 201 else if (strncmpic(keystring, US"dnssec_", 7) == 0)
ff4dbb19 202 {
fd3b6a4a
JH
203 keystring += 7;
204 if (strncmpic(keystring, US"strict", 6) == 0)
fd7f7910 205 { dnssec_mode = DEFER; keystring += 6; }
fd3b6a4a 206 else if (strncmpic(keystring, US"lax", 3) == 0)
fd7f7910
JH
207 { dnssec_mode = PASS; keystring += 3; }
208 else if (strncmpic(keystring, US"never", 5) == 0)
209 { dnssec_mode = OK; keystring += 5; }
210 else
fd3b6a4a 211 {
fd7f7910
JH
212 *errmsg = US"unsupported dnsdb dnssec behaviour";
213 return DEFER;
fd3b6a4a 214 }
fd7f7910
JH
215 }
216 else if (strncmpic(keystring, US"retrans_", 8) == 0)
217 {
218 int timeout_sec;
219 if ((timeout_sec = readconf_readtime(keystring += 8, ',', FALSE)) <= 0)
fd3b6a4a 220 {
fd7f7910
JH
221 *errmsg = US"unsupported dnsdb timeout value";
222 return DEFER;
fd3b6a4a 223 }
fd7f7910
JH
224 dns_retrans = timeout_sec;
225 while (*keystring != ',') keystring++;
226 }
227 else if (strncmpic(keystring, US"retry_", 6) == 0)
228 {
229 int retries;
fc362fc5 230 if ((retries = (int)strtol(CCS keystring + 6, CSS &keystring, 0)) < 0)
fd3b6a4a 231 {
fd7f7910 232 *errmsg = US"unsupported dnsdb retry count";
fd3b6a4a
JH
233 return DEFER;
234 }
fd7f7910 235 dns_retry = retries;
ff4dbb19 236 }
fd7f7910
JH
237 else
238 break;
239
ff4dbb19
PH
240 while (isspace(*keystring)) keystring++;
241 if (*keystring++ != ',')
242 {
fd3b6a4a 243 *errmsg = US"dnsdb modifier syntax error";
ff4dbb19
PH
244 return DEFER;
245 }
246 while (isspace(*keystring)) keystring++;
247 }
248
542bc632
PP
249/* Figure out the "type" value if it is not T_TXT.
250If the keystring contains an = this must be preceded by a valid type name. */
7bb56e1f 251
542bc632 252type = T_TXT;
7bb56e1f
PH
253if ((equals = Ustrchr(keystring, '=')) != NULL)
254 {
255 int i, len;
256 uschar *tend = equals;
8e669ac1
PH
257
258 while (tend > keystring && isspace(tend[-1])) tend--;
259 len = tend - keystring;
260
9be4572b 261 for (i = 0; i < nelem(type_names); i++)
0756eb3c
PH
262 if (len == Ustrlen(type_names[i]) &&
263 strncmpic(keystring, US type_names[i], len) == 0)
264 {
265 type = type_values[i];
266 break;
267 }
8e669ac1 268
9be4572b 269 if (i >= nelem(type_names))
0756eb3c
PH
270 {
271 *errmsg = US"unsupported DNS record type";
272 return DEFER;
273 }
8e669ac1 274
7bb56e1f
PH
275 keystring = equals + 1;
276 while (isspace(*keystring)) keystring++;
0756eb3c 277 }
8e669ac1 278
7bb56e1f 279/* Initialize the resolver in case this is the first time it has been used. */
0756eb3c 280
fd3b6a4a 281dns_init(FALSE, FALSE, dnssec_mode != OK);
0756eb3c 282
8e669ac1
PH
283/* The remainder of the string must be a list of domains. As long as the lookup
284for at least one of them succeeds, we return success. Failure means that none
285of them were found.
0756eb3c 286
8e669ac1
PH
287The original implementation did not support a list of domains. Adding the list
288feature is compatible, except in one case: when PTR records are being looked up
289for a single IPv6 address. Fortunately, we can hack in a compatibility feature
290here: If the type is PTR and no list separator is specified, and the entire
291remaining string is valid as an IP address, set an impossible separator so that
7bb56e1f 292it is treated as one item. */
33397d19 293
7bb56e1f 294if (type == T_PTR && keystring[0] != '<' &&
7e66e54d 295 string_is_ip_address(keystring, NULL) != 0)
7bb56e1f 296 sep = -1;
0756eb3c 297
542bc632
PP
298/* SPF strings should be concatenated without a separator, thus make
299it the default if not defined (see RFC 4408 section 3.1.3).
300Multiple SPF records are forbidden (section 3.1.2) but are currently
be36e572
JH
301not handled specially, thus they are concatenated with \n by default.
302MX priority and value are space-separated by default.
303SRV and TLSA record parts are space-separated by default. */
542bc632 304
be36e572
JH
305if (!outsep2) switch(type)
306 {
307 case T_SPF: outsep2 = US""; break;
308 case T_SRV: case T_MX: case T_TLSA: outsep2 = US" "; break;
309 }
542bc632 310
7bb56e1f 311/* Now scan the list and do a lookup for each item */
0756eb3c 312
fd7f7910 313while ((domain = string_nextinlist(&keystring, &sep, NULL, 0)))
8e669ac1 314 {
b09c1793
JH
315 int searchtype = type == T_CSA ? T_SRV : /* record type we want */
316 type == T_MXH ? T_MX :
317 type == T_ZNS ? T_NS : type;
e5a9dba6
PH
318
319 /* If the type is PTR or CSA, we have to construct the relevant magic lookup
320 key if the original is an IP address (some experimental protocols are using
321 PTR records for different purposes where the key string is a host name, and
322 Exim's extended CSA can be keyed by domains or IP addresses). This code for
323 doing the reversal is now in a separate function. */
324
325 if ((type == T_PTR || type == T_CSA) &&
7e66e54d 326 string_is_ip_address(domain, NULL) != 0)
152481a0 327 domain = dns_build_reverse(domain);
8e669ac1 328
3a796370 329 do
c38d6da9 330 {
42c7f0b4 331 DEBUG(D_lookup) debug_printf_indent("dnsdb key: %s\n", domain);
3a796370
JH
332
333 /* Do the lookup and sort out the result. There are four special types that
66be95e0 334 are handled specially: T_CSA, T_ZNS, T_ADDRESSES and T_MXH.
3a796370 335 The first two are handled in a special lookup function so that the facility
66be95e0 336 could be used from other parts of the Exim code. T_ADDRESSES is handled by looping
3a796370
JH
337 over the types of A lookup. T_MXH affects only what happens later on in
338 this function, but for tidiness it is handled by the "special". If the
339 lookup fails, continue with the next domain. In the case of DEFER, adjust
340 the final "nothing found" result, but carry on to the next domain. */
341
342 found = domain;
6abc190a 343#if HAVE_IPV6
66be95e0 344 if (type == T_ADDRESSES) /* NB cannot happen unless HAVE_IPV6 */
3a796370 345 {
cc00f4af 346 if (searchtype == T_ADDRESSES) searchtype = T_AAAA;
3a796370 347 else if (searchtype == T_AAAA) searchtype = T_A;
8743d3ac 348 rc = dns_special_lookup(dnsa, domain, searchtype, CUSS &found);
3a796370
JH
349 }
350 else
6abc190a 351#endif
8743d3ac 352 rc = dns_special_lookup(dnsa, domain, type, CUSS &found);
ea3bc19b 353
4e0983dc 354 lookup_dnssec_authenticated = dnssec_mode==OK ? NULL
8743d3ac 355 : dns_is_secure(dnsa) ? US"yes" : US"no";
4e0983dc 356
3a796370 357 if (rc == DNS_NOMATCH || rc == DNS_NODATA) continue;
91f40ccd 358 if ( rc != DNS_SUCCEED
8743d3ac 359 || (dnssec_mode == DEFER && !dns_is_secure(dnsa))
91f40ccd 360 )
3a796370 361 {
fd3b6a4a
JH
362 if (defer_mode == DEFER)
363 {
fd7f7910
JH
364 dns_retrans = save_retrans;
365 dns_retry = save_retry;
9d9c3746 366 dns_init(FALSE, FALSE, FALSE); /* clr dnssec bit */
fd3b6a4a
JH
367 return DEFER; /* always defer */
368 }
3a796370
JH
369 if (defer_mode == PASS) failrc = DEFER; /* defer only if all do */
370 continue; /* treat defer as fail */
371 }
fd3b6a4a 372
8e669ac1 373
3a796370 374 /* Search the returned records */
8e669ac1 375
8743d3ac
JH
376 for (dns_record * rr = dns_next_rr(dnsa, &dnss, RESET_ANSWERS); rr;
377 rr = dns_next_rr(dnsa, &dnss, RESET_NEXT)) if (rr->type == searchtype)
0756eb3c 378 {
14b3c5bc
JH
379 if (*do_cache > rr->ttl)
380 *do_cache = rr->ttl;
381
cc00f4af 382 if (type == T_A || type == T_AAAA || type == T_ADDRESSES)
7bb56e1f 383 {
8743d3ac 384 for (dns_address * da = dns_address_from_rr(dnsa, rr); da; da = da->next)
3a796370 385 {
acec9514
JH
386 if (yield->ptr) yield = string_catn(yield, outsep, 1);
387 yield = string_cat(yield, da->address);
3a796370
JH
388 }
389 continue;
7bb56e1f 390 }
8e669ac1 391
3a796370
JH
392 /* Other kinds of record just have one piece of data each, but there may be
393 several of them, of course. */
8e669ac1 394
acec9514 395 if (yield->ptr) yield = string_catn(yield, outsep, 1);
8e669ac1 396
3a796370 397 if (type == T_TXT || type == T_SPF)
80a47a2c 398 {
acec9514
JH
399 if (outsep2 == NULL) /* output only the first item of data */
400 yield = string_catn(yield, US (rr->data+1), (rr->data)[0]);
3a796370
JH
401 else
402 {
403 /* output all items */
404 int data_offset = 0;
405 while (data_offset < rr->size)
406 {
407 uschar chunk_len = (rr->data)[data_offset++];
408 if (outsep2[0] != '\0' && data_offset != 1)
acec9514
JH
409 yield = string_catn(yield, outsep2, 1);
410 yield = string_catn(yield, US ((rr->data)+data_offset), chunk_len);
3a796370
JH
411 data_offset += chunk_len;
412 }
0d0c6357 413 }
80a47a2c 414 }
1e06383a
TL
415 else if (type == T_TLSA)
416 {
417 uint8_t usage, selector, matching_type;
624f33df 418 uint16_t payload_length;
1e06383a
TL
419 uschar s[MAX_TLSA_EXPANDED_SIZE];
420 uschar * sp = s;
d2a2c69b 421 uschar * p = US rr->data;
1e06383a
TL
422
423 usage = *p++;
424 selector = *p++;
425 matching_type = *p++;
426 /* What's left after removing the first 3 bytes above */
427 payload_length = rr->size - 3;
be36e572
JH
428 sp += sprintf(CS s, "%d%c%d%c%d%c", usage, *outsep2,
429 selector, *outsep2, matching_type, *outsep2);
1e06383a 430 /* Now append the cert/identifier, one hex char at a time */
624f33df
JH
431 while (payload_length-- > 0 && sp-s < (MAX_TLSA_EXPANDED_SIZE - 4))
432 sp += sprintf(CS sp, "%02x", *p++);
d2a2c69b 433
acec9514 434 yield = string_cat(yield, s);
1e06383a 435 }
d2a2c69b 436 else /* T_CNAME, T_CSA, T_MX, T_MXH, T_NS, T_PTR, T_SOA, T_SRV */
e5a9dba6 437 {
3a796370
JH
438 int priority, weight, port;
439 uschar s[264];
d2a2c69b
JH
440 uschar * p = US rr->data;
441
442 switch (type)
443 {
444 case T_MXH:
445 /* mxh ignores the priority number and includes only the hostnames */
446 GETSHORT(priority, p);
447 break;
448
449 case T_MX:
450 GETSHORT(priority, p);
451 sprintf(CS s, "%d%c", priority, *outsep2);
acec9514 452 yield = string_cat(yield, s);
d2a2c69b
JH
453 break;
454
455 case T_SRV:
456 GETSHORT(priority, p);
457 GETSHORT(weight, p);
458 GETSHORT(port, p);
459 sprintf(CS s, "%d%c%d%c%d%c", priority, *outsep2,
460 weight, *outsep2, port, *outsep2);
acec9514 461 yield = string_cat(yield, s);
d2a2c69b
JH
462 break;
463
464 case T_CSA:
465 /* See acl_verify_csa() for more comments about CSA. */
466 GETSHORT(priority, p);
467 GETSHORT(weight, p);
468 GETSHORT(port, p);
469
470 if (priority != 1) continue; /* CSA version must be 1 */
471
472 /* If the CSA record we found is not the one we asked for, analyse
473 the subdomain assertions in the port field, else analyse the direct
474 authorization status in the weight field. */
475
476 if (Ustrcmp(found, domain) != 0)
477 {
478 if (port & 1) *s = 'X'; /* explicit authorization required */
479 else *s = '?'; /* no subdomain assertions here */
480 }
481 else
482 {
483 if (weight < 2) *s = 'N'; /* not authorized */
484 else if (weight == 2) *s = 'Y'; /* authorized */
485 else if (weight == 3) *s = '?'; /* unauthorizable */
486 else continue; /* invalid */
487 }
488
489 s[1] = ' ';
acec9514 490 yield = string_catn(yield, s, 2);
d2a2c69b
JH
491 break;
492
493 default:
494 break;
495 }
e5a9dba6 496
3a796370 497 /* GETSHORT() has advanced the pointer to the target domain. */
8e669ac1 498
8743d3ac 499 rc = dn_expand(dnsa->answer, dnsa->answer + dnsa->answerlen, p,
d2a2c69b 500 (DN_EXPAND_ARG4_TYPE)s, sizeof(s));
8e669ac1 501
3a796370
JH
502 /* If an overlong response was received, the data will have been
503 truncated and dn_expand may fail. */
8e669ac1 504
3a796370
JH
505 if (rc < 0)
506 {
507 log_write(0, LOG_MAIN, "host name alias list truncated: type=%s "
508 "domain=%s", dns_text_type(type), domain);
509 break;
510 }
acec9514 511 else yield = string_cat(yield, s);
d2a2c69b
JH
512
513 if (type == T_SOA && outsep2 != NULL)
514 {
515 unsigned long serial, refresh, retry, expire, minimum;
516
517 p += rc;
acec9514 518 yield = string_catn(yield, outsep2, 1);
d2a2c69b 519
8743d3ac 520 rc = dn_expand(dnsa->answer, dnsa->answer + dnsa->answerlen, p,
d2a2c69b
JH
521 (DN_EXPAND_ARG4_TYPE)s, sizeof(s));
522 if (rc < 0)
523 {
524 log_write(0, LOG_MAIN, "responsible-mailbox truncated: type=%s "
525 "domain=%s", dns_text_type(type), domain);
526 break;
527 }
acec9514 528 else yield = string_cat(yield, s);
d2a2c69b
JH
529
530 p += rc;
531 GETLONG(serial, p); GETLONG(refresh, p);
532 GETLONG(retry, p); GETLONG(expire, p); GETLONG(minimum, p);
fc362fc5 533 sprintf(CS s, "%c%lu%c%lu%c%lu%c%lu%c%lu",
d2a2c69b
JH
534 *outsep2, serial, *outsep2, refresh,
535 *outsep2, retry, *outsep2, expire, *outsep2, minimum);
acec9514 536 yield = string_cat(yield, s);
d2a2c69b 537 }
7bb56e1f 538 }
3a796370
JH
539 } /* Loop for list of returned records */
540
4c04137d 541 /* Loop for set of A-lookup types */
66be95e0 542 } while (type == T_ADDRESSES && searchtype != T_A);
3a796370
JH
543
544 } /* Loop for list of domains */
7bb56e1f
PH
545
546/* Reclaim unused memory */
0756eb3c 547
f3ebb786 548gstring_release_unused(yield);
7bb56e1f 549
acec9514 550/* If yield NULL we have not found anything. Otherwise, insert the terminating
7bb56e1f
PH
551zero and return the result. */
552
fd7f7910
JH
553dns_retrans = save_retrans;
554dns_retry = save_retry;
fd3b6a4a
JH
555dns_init(FALSE, FALSE, FALSE); /* clear the dnssec bit for getaddrbyname */
556
acec9514
JH
557if (!yield || !yield->ptr) return failrc;
558
559*result = string_from_gstring(yield);
0756eb3c
PH
560return OK;
561}
562
6545de78
PP
563
564
565/*************************************************
566* Version reporting entry point *
567*************************************************/
568
569/* See local README for interface description. */
570
571#include "../version.h"
572
573void
574dnsdb_version_report(FILE *f)
575{
576#ifdef DYNLOOKUP
577fprintf(f, "Library version: DNSDB: Exim version %s\n", EXIM_VERSION_STR);
578#endif
579}
580
581
e6d225ae
DW
582static lookup_info _lookup_info = {
583 US"dnsdb", /* lookup name */
584 lookup_querystyle, /* query style */
585 dnsdb_open, /* open function */
586 NULL, /* check function */
587 dnsdb_find, /* find function */
588 NULL, /* no close function */
589 NULL, /* no tidy function */
6545de78
PP
590 NULL, /* no quoting function */
591 dnsdb_version_report /* version reporting */
e6d225ae
DW
592};
593
594#ifdef DYNLOOKUP
595#define dnsdb_lookup_module_info _lookup_module_info
596#endif
597
598static lookup_info *_lookup_list[] = { &_lookup_info };
599lookup_module_info dnsdb_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
600
fd3b6a4a
JH
601/* vi: aw ai sw=2
602*/
0756eb3c 603/* End of lookups/dnsdb.c */