| 1 | /* $Cambridge: exim/src/src/drtables.c,v 1.9 2007/09/28 12:21:57 tom Exp $ */ |
| 2 | |
| 3 | /************************************************* |
| 4 | * Exim - an Internet mail transport agent * |
| 5 | *************************************************/ |
| 6 | |
| 7 | /* Copyright (c) University of Cambridge 1995 - 2007 */ |
| 8 | /* See the file NOTICE for conditions of use and distribution. */ |
| 9 | |
| 10 | |
| 11 | #include "exim.h" |
| 12 | |
| 13 | |
| 14 | /* This module contains tables that define the lookup methods and drivers |
| 15 | that are actually included in the binary. Its contents are controlled by |
| 16 | various macros in config.h that ultimately come from Local/Makefile. They are |
| 17 | all described in src/EDITME. */ |
| 18 | |
| 19 | |
| 20 | /* The OSF1 (Digital Unix) linker puts out a worrying warning if any sections |
| 21 | contain no executable code. It says |
| 22 | |
| 23 | Warning: Linking some objects which contain exception information sections |
| 24 | and some which do not. This may cause fatal runtime exception handling |
| 25 | problems. |
| 26 | |
| 27 | As this may cause people to worry needlessly, include a dummy function here |
| 28 | to stop the message from appearing. Make it call itself to stop picky compilers |
| 29 | compilers complaining that it is unused, and put in a dummy argument to stop |
| 30 | even pickier compilers complaining about infinite loops. */ |
| 31 | |
| 32 | static void dummy(int x) { dummy(x-1); } |
| 33 | |
| 34 | |
| 35 | /* Table of information about all possible lookup methods. The entries are |
| 36 | always present, but the "open" and "find" functions are set to NULL for those |
| 37 | that are not compiled into the binary. The "check" and "close" functions can |
| 38 | be NULL for methods that don't need them. */ |
| 39 | |
| 40 | #ifdef LOOKUP_CDB |
| 41 | #include "lookups/cdb.h" |
| 42 | #endif |
| 43 | |
| 44 | #ifdef LOOKUP_DBM |
| 45 | #include "lookups/dbmdb.h" |
| 46 | #endif |
| 47 | |
| 48 | #ifdef LOOKUP_DNSDB |
| 49 | #include "lookups/dnsdb.h" |
| 50 | #endif |
| 51 | |
| 52 | #ifdef LOOKUP_DSEARCH |
| 53 | #include "lookups/dsearch.h" |
| 54 | #endif |
| 55 | |
| 56 | #ifdef LOOKUP_IBASE |
| 57 | #include "lookups/ibase.h" |
| 58 | #endif |
| 59 | |
| 60 | #ifdef LOOKUP_LDAP |
| 61 | #include "lookups/ldap.h" |
| 62 | #endif |
| 63 | |
| 64 | #ifdef LOOKUP_LSEARCH |
| 65 | #include "lookups/lsearch.h" |
| 66 | #endif |
| 67 | |
| 68 | #ifdef LOOKUP_MYSQL |
| 69 | #include "lookups/mysql.h" |
| 70 | #endif |
| 71 | |
| 72 | #ifdef LOOKUP_NIS |
| 73 | #include "lookups/nis.h" |
| 74 | #endif |
| 75 | |
| 76 | #ifdef LOOKUP_NISPLUS |
| 77 | #include "lookups/nisplus.h" |
| 78 | #endif |
| 79 | |
| 80 | #ifdef LOOKUP_ORACLE |
| 81 | #include "lookups/oracle.h" |
| 82 | #endif |
| 83 | |
| 84 | #ifdef LOOKUP_PASSWD |
| 85 | #include "lookups/passwd.h" |
| 86 | #endif |
| 87 | |
| 88 | #ifdef LOOKUP_PGSQL |
| 89 | #include "lookups/pgsql.h" |
| 90 | #endif |
| 91 | |
| 92 | #ifdef EXPERIMENTAL_SPF |
| 93 | #include "lookups/spf.h" |
| 94 | #endif |
| 95 | |
| 96 | #ifdef LOOKUP_SQLITE |
| 97 | #include "lookups/sqlite.h" |
| 98 | #endif |
| 99 | |
| 100 | #ifdef LOOKUP_TESTDB |
| 101 | #include "lookups/testdb.h" |
| 102 | #endif |
| 103 | |
| 104 | #ifdef LOOKUP_WHOSON |
| 105 | #include "lookups/whoson.h" |
| 106 | #endif |
| 107 | |
| 108 | #ifdef EXPERIMENTAL_DKIM |
| 109 | #include "lookups/dkim.h" |
| 110 | #endif |
| 111 | |
| 112 | |
| 113 | /* The second field in each item below is a set of bit flags: |
| 114 | |
| 115 | lookup_querystyle => this is a query-style lookup, |
| 116 | else single-key (+ file) style |
| 117 | lookup_absfile => an absolute file name is required, |
| 118 | (for single-key style only) |
| 119 | |
| 120 | This list must be in alphabetical order of lookup name because it is |
| 121 | searched by binary chop, having got rather large for the original linear |
| 122 | searching. */ |
| 123 | |
| 124 | lookup_info lookup_list[] = { |
| 125 | |
| 126 | /* cdb lookup in single file */ |
| 127 | |
| 128 | { |
| 129 | US"cdb", /* lookup name */ |
| 130 | lookup_absfile, /* uses absolute file name */ |
| 131 | #ifdef LOOKUP_CDB |
| 132 | cdb_open, /* open function */ |
| 133 | cdb_check, /* check function */ |
| 134 | cdb_find, /* find function */ |
| 135 | cdb_close, /* close function */ |
| 136 | NULL, /* no tidy function */ |
| 137 | NULL /* no quoting function */ |
| 138 | #else |
| 139 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 140 | #endif |
| 141 | }, |
| 142 | |
| 143 | /* DBM file lookup; called "dbm" because that is the name in Exim, |
| 144 | but the code is called dbmdb to avoid name clashes. */ |
| 145 | |
| 146 | { |
| 147 | US"dbm", /* lookup name */ |
| 148 | lookup_absfile, /* uses absolute file name */ |
| 149 | #ifdef LOOKUP_DBM |
| 150 | dbmdb_open, /* open function */ |
| 151 | dbmdb_check, /* check function */ |
| 152 | dbmdb_find, /* find function */ |
| 153 | dbmdb_close, /* close function */ |
| 154 | NULL, /* no tidy function */ |
| 155 | NULL /* no quoting function */ |
| 156 | #else |
| 157 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 158 | #endif |
| 159 | }, |
| 160 | |
| 161 | /* This variant of DBM does not include the binary zero on the end |
| 162 | of the key strings. */ |
| 163 | |
| 164 | { |
| 165 | US"dbmnz", /* lookup name */ |
| 166 | lookup_absfile, /* uses absolute file name */ |
| 167 | #ifdef LOOKUP_DBM |
| 168 | dbmdb_open, /* sic */ /* open function */ |
| 169 | dbmdb_check, /* sic */ /* check function */ |
| 170 | dbmnz_find, /* find function */ |
| 171 | dbmdb_close, /* sic */ /* close function */ |
| 172 | NULL, /* no tidy function */ |
| 173 | NULL /* no quoting function */ |
| 174 | #else |
| 175 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 176 | #endif |
| 177 | }, |
| 178 | |
| 179 | /* DKIM lookups */ |
| 180 | |
| 181 | { |
| 182 | US"dkim", /* lookup name */ |
| 183 | lookup_querystyle, /* query style */ |
| 184 | #ifdef EXPERIMENTAL_DKIM |
| 185 | dkim_open, /* open function */ |
| 186 | NULL, /* check function */ |
| 187 | dkim_find, /* find function */ |
| 188 | NULL, /* no close function */ |
| 189 | NULL, /* no tidy function */ |
| 190 | NULL /* no quoting function */ |
| 191 | #else |
| 192 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 193 | #endif |
| 194 | }, |
| 195 | |
| 196 | /* Using DNS TXT records as a database */ |
| 197 | |
| 198 | { |
| 199 | US"dnsdb", /* lookup name */ |
| 200 | lookup_querystyle, /* query style */ |
| 201 | #ifdef LOOKUP_DNSDB |
| 202 | dnsdb_open, /* open function */ |
| 203 | NULL, /* check function */ |
| 204 | dnsdb_find, /* find function */ |
| 205 | NULL, /* no close function */ |
| 206 | NULL, /* no tidy function */ |
| 207 | NULL /* no quoting function */ |
| 208 | #else |
| 209 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 210 | #endif |
| 211 | }, |
| 212 | |
| 213 | /* Search of files in a directory */ |
| 214 | |
| 215 | { |
| 216 | US"dsearch", /* lookup name */ |
| 217 | lookup_absfile, /* uses absolute file name */ |
| 218 | #ifdef LOOKUP_DSEARCH |
| 219 | dsearch_open, /* open function */ |
| 220 | dsearch_check, /* check function */ |
| 221 | dsearch_find, /* find function */ |
| 222 | dsearch_close, /* close function */ |
| 223 | NULL, /* no tidy function */ |
| 224 | NULL /* no quoting function */ |
| 225 | #else |
| 226 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 227 | #endif |
| 228 | }, |
| 229 | |
| 230 | /* Interbase lookup */ |
| 231 | |
| 232 | { |
| 233 | US"ibase", /* lookup name */ |
| 234 | lookup_querystyle, /* query-style lookup */ |
| 235 | #ifdef LOOKUP_IBASE |
| 236 | ibase_open, /* open function */ |
| 237 | NULL, /* no check function */ |
| 238 | ibase_find, /* find function */ |
| 239 | NULL, /* no close function */ |
| 240 | ibase_tidy, /* tidy function */ |
| 241 | ibase_quote /* quoting function */ |
| 242 | #else |
| 243 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 244 | #endif |
| 245 | }, |
| 246 | |
| 247 | /* Linear search of single file with ip-addresses and networks; shares many |
| 248 | functions with lsearch. */ |
| 249 | |
| 250 | { |
| 251 | US"iplsearch", /* lookup name */ |
| 252 | lookup_absfile, /* uses absolute file name */ |
| 253 | #ifdef LOOKUP_LSEARCH |
| 254 | lsearch_open, /* open function */ |
| 255 | lsearch_check, /* check function */ |
| 256 | iplsearch_find, /* find function */ |
| 257 | lsearch_close, /* close function */ |
| 258 | NULL, /* no tidy function */ |
| 259 | NULL /* no quoting function */ |
| 260 | #else |
| 261 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 262 | #endif |
| 263 | }, |
| 264 | |
| 265 | /* LDAP lookup, allowing data from only one entry to be returned */ |
| 266 | |
| 267 | { |
| 268 | US"ldap", /* lookup name */ |
| 269 | lookup_querystyle, /* query-style lookup */ |
| 270 | #ifdef LOOKUP_LDAP |
| 271 | eldap_open, /* open function */ |
| 272 | NULL, /* check function */ |
| 273 | eldap_find, /* find function */ |
| 274 | NULL, /* no close function */ |
| 275 | eldap_tidy, /* tidy function */ |
| 276 | eldap_quote /* quoting function */ |
| 277 | #else |
| 278 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 279 | #endif |
| 280 | }, |
| 281 | |
| 282 | /* LDAP lookup, allowing the DN from more one entry to be returned */ |
| 283 | |
| 284 | { |
| 285 | US"ldapdn", /* lookup name */ |
| 286 | lookup_querystyle, /* query-style lookup */ |
| 287 | #ifdef LOOKUP_LDAP |
| 288 | eldap_open, /* sic */ /* open function */ |
| 289 | NULL, /* check function */ |
| 290 | eldapdn_find, /* find function */ |
| 291 | NULL, /* no close function */ |
| 292 | eldap_tidy, /* sic */ /* tidy function */ |
| 293 | eldap_quote /* sic */ /* quoting function */ |
| 294 | #else |
| 295 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 296 | #endif |
| 297 | }, |
| 298 | |
| 299 | /* LDAP lookup, allowing data from more than one entry to be returned */ |
| 300 | |
| 301 | { |
| 302 | US"ldapm", /* lookup name */ |
| 303 | lookup_querystyle, /* query-style lookup */ |
| 304 | #ifdef LOOKUP_LDAP |
| 305 | eldap_open, /* sic */ /* open function */ |
| 306 | NULL, /* check function */ |
| 307 | eldapm_find, /* find function */ |
| 308 | NULL, /* no close function */ |
| 309 | eldap_tidy, /* sic */ /* tidy function */ |
| 310 | eldap_quote /* sic */ /* quoting function */ |
| 311 | #else |
| 312 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 313 | #endif |
| 314 | }, |
| 315 | |
| 316 | /* Linear search of single file */ |
| 317 | |
| 318 | { |
| 319 | US"lsearch", /* lookup name */ |
| 320 | lookup_absfile, /* uses absolute file name */ |
| 321 | #ifdef LOOKUP_LSEARCH |
| 322 | lsearch_open, /* open function */ |
| 323 | lsearch_check, /* check function */ |
| 324 | lsearch_find, /* find function */ |
| 325 | lsearch_close, /* close function */ |
| 326 | NULL, /* no tidy function */ |
| 327 | NULL /* no quoting function */ |
| 328 | #else |
| 329 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 330 | #endif |
| 331 | }, |
| 332 | |
| 333 | /* MYSQL lookup */ |
| 334 | |
| 335 | { |
| 336 | US"mysql", /* lookup name */ |
| 337 | lookup_querystyle, /* query-style lookup */ |
| 338 | #ifdef LOOKUP_MYSQL |
| 339 | mysql_open, /* open function */ |
| 340 | NULL, /* no check function */ |
| 341 | mysql_find, /* find function */ |
| 342 | NULL, /* no close function */ |
| 343 | mysql_tidy, /* tidy function */ |
| 344 | mysql_quote /* quoting function */ |
| 345 | #else |
| 346 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 347 | #endif |
| 348 | }, |
| 349 | |
| 350 | /* NIS lookup, excluding trailing 0 from key */ |
| 351 | |
| 352 | { |
| 353 | US"nis", /* lookup name */ |
| 354 | 0, /* not abs file, not query style*/ |
| 355 | #ifdef LOOKUP_NIS |
| 356 | nis_open, /* open function */ |
| 357 | NULL, /* check function */ |
| 358 | nis_find, /* find function */ |
| 359 | NULL, /* no close function */ |
| 360 | NULL, /* no tidy function */ |
| 361 | NULL /* no quoting function */ |
| 362 | #else |
| 363 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 364 | #endif |
| 365 | }, |
| 366 | |
| 367 | /* NIS lookup, including trailing 0 in key */ |
| 368 | |
| 369 | { |
| 370 | US"nis0", /* lookup name */ |
| 371 | 0, /* not absfile, not query style */ |
| 372 | #ifdef LOOKUP_NIS |
| 373 | nis_open, /* sic */ /* open function */ |
| 374 | NULL, /* check function */ |
| 375 | nis0_find, /* find function */ |
| 376 | NULL, /* no close function */ |
| 377 | NULL, /* no tidy function */ |
| 378 | NULL /* no quoting function */ |
| 379 | #else |
| 380 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 381 | #endif |
| 382 | }, |
| 383 | |
| 384 | /* NIS+ lookup */ |
| 385 | |
| 386 | { |
| 387 | US"nisplus", /* lookup name */ |
| 388 | lookup_querystyle, /* query-style lookup */ |
| 389 | #ifdef LOOKUP_NISPLUS |
| 390 | nisplus_open, /* open function */ |
| 391 | NULL, /* check function */ |
| 392 | nisplus_find, /* find function */ |
| 393 | NULL, /* no close function */ |
| 394 | NULL, /* no tidy function */ |
| 395 | nisplus_quote /* quoting function */ |
| 396 | #else |
| 397 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 398 | #endif |
| 399 | }, |
| 400 | |
| 401 | /* Linear search of single file, with wildcarding but no pattern expansion. |
| 402 | Shares many functions with lsearch. */ |
| 403 | |
| 404 | { |
| 405 | US"nwildlsearch", /* lookup name */ |
| 406 | lookup_absfile, /* uses absolute file name */ |
| 407 | #ifdef LOOKUP_LSEARCH |
| 408 | lsearch_open, /* open function */ |
| 409 | lsearch_check, /* check function */ |
| 410 | nwildlsearch_find, /* find function */ |
| 411 | lsearch_close, /* close function */ |
| 412 | NULL, /* no tidy function */ |
| 413 | NULL /* no quoting function */ |
| 414 | #else |
| 415 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 416 | #endif |
| 417 | }, |
| 418 | |
| 419 | /* Oracle lookup */ |
| 420 | |
| 421 | { |
| 422 | US"oracle", /* lookup name */ |
| 423 | lookup_querystyle, /* query-style lookup */ |
| 424 | #ifdef LOOKUP_ORACLE |
| 425 | oracle_open, /* open function */ |
| 426 | NULL, /* check function */ |
| 427 | oracle_find, /* find function */ |
| 428 | NULL, /* no close function */ |
| 429 | oracle_tidy, /* tidy function */ |
| 430 | oracle_quote /* quoting function */ |
| 431 | #else |
| 432 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 433 | #endif |
| 434 | }, |
| 435 | |
| 436 | /* passwd lookup */ |
| 437 | |
| 438 | { |
| 439 | US"passwd", /* lookup name */ |
| 440 | lookup_querystyle, /* query-style lookup */ |
| 441 | #ifdef LOOKUP_PASSWD |
| 442 | passwd_open, /* open function */ |
| 443 | NULL, /* no check function */ |
| 444 | passwd_find, /* find function */ |
| 445 | NULL, /* no close function */ |
| 446 | NULL, /* no tidy function */ |
| 447 | NULL /* no quoting function */ |
| 448 | #else |
| 449 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 450 | #endif |
| 451 | }, |
| 452 | |
| 453 | /* PGSQL lookup */ |
| 454 | |
| 455 | { |
| 456 | US"pgsql", /* lookup name */ |
| 457 | lookup_querystyle, /* query-style lookup */ |
| 458 | #ifdef LOOKUP_PGSQL |
| 459 | pgsql_open, /* open function */ |
| 460 | NULL, /* no check function */ |
| 461 | pgsql_find, /* find function */ |
| 462 | NULL, /* no close function */ |
| 463 | pgsql_tidy, /* tidy function */ |
| 464 | pgsql_quote /* quoting function */ |
| 465 | #else |
| 466 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 467 | #endif |
| 468 | }, |
| 469 | |
| 470 | /* SPF lookup */ |
| 471 | |
| 472 | { |
| 473 | US"spf", /* lookup name */ |
| 474 | 0, /* not absfile, not query style */ |
| 475 | #ifdef EXPERIMENTAL_SPF |
| 476 | spf_open, /* open function */ |
| 477 | NULL, /* no check function */ |
| 478 | spf_find, /* find function */ |
| 479 | spf_close, /* close function */ |
| 480 | NULL, /* no tidy function */ |
| 481 | NULL /* no quoting function */ |
| 482 | #else |
| 483 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 484 | #endif |
| 485 | }, |
| 486 | |
| 487 | /* sqlite lookup */ |
| 488 | |
| 489 | { |
| 490 | US"sqlite", /* lookup name */ |
| 491 | lookup_absfilequery, /* query-style lookup, starts with file name */ |
| 492 | #ifdef LOOKUP_SQLITE |
| 493 | sqlite_open, /* open function */ |
| 494 | NULL, /* no check function */ |
| 495 | sqlite_find, /* find function */ |
| 496 | sqlite_close, /* close function */ |
| 497 | NULL, /* no tidy function */ |
| 498 | sqlite_quote /* quoting function */ |
| 499 | #else |
| 500 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 501 | #endif |
| 502 | }, |
| 503 | |
| 504 | /* Testdb lookup is for testing Exim, not useful for normal running. |
| 505 | For that reason, we omit the entry entirely when not building it into |
| 506 | the binary, so that attempts to use it give "unknown lookup type" instead |
| 507 | of "lookup type not available". */ |
| 508 | |
| 509 | #ifdef LOOKUP_TESTDB |
| 510 | { |
| 511 | US"testdb", /* lookup name */ |
| 512 | lookup_querystyle, /* query-style lookup */ |
| 513 | testdb_open, /* open function */ |
| 514 | NULL, /* check function */ |
| 515 | testdb_find, /* find function */ |
| 516 | NULL, /* no close function */ |
| 517 | NULL, /* no tidy function */ |
| 518 | NULL /* no quoting function */ |
| 519 | }, |
| 520 | #endif |
| 521 | |
| 522 | /* "Whoson" lookup */ |
| 523 | |
| 524 | { |
| 525 | US"whoson", /* lookup name */ |
| 526 | lookup_querystyle, /* query-style lookup */ |
| 527 | #ifdef LOOKUP_WHOSON |
| 528 | whoson_open, /* open function */ |
| 529 | NULL, /* check function */ |
| 530 | whoson_find, /* find function */ |
| 531 | NULL, /* no close function */ |
| 532 | NULL, /* no tidy function */ |
| 533 | NULL /* no quoting function */ |
| 534 | #else |
| 535 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 536 | #endif |
| 537 | }, |
| 538 | |
| 539 | /* Linear search of single file, with wildcarding and pattern expansion. Shares |
| 540 | many functions with lsearch. */ |
| 541 | |
| 542 | { |
| 543 | US"wildlsearch", /* lookup name */ |
| 544 | lookup_absfile, /* uses absolute file name */ |
| 545 | #ifdef LOOKUP_LSEARCH |
| 546 | lsearch_open, /* open function */ |
| 547 | lsearch_check, /* check function */ |
| 548 | wildlsearch_find, /* find function */ |
| 549 | lsearch_close, /* close function */ |
| 550 | NULL, /* no tidy function */ |
| 551 | NULL /* no quoting function */ |
| 552 | #else |
| 553 | NULL, NULL, NULL, NULL, NULL, NULL /* lookup not present */ |
| 554 | #endif |
| 555 | } |
| 556 | }; |
| 557 | |
| 558 | /* Number of entries in the list */ |
| 559 | |
| 560 | int lookup_list_count = sizeof(lookup_list)/sizeof(lookup_info); |
| 561 | |
| 562 | |
| 563 | |
| 564 | /* Table of information about all possible authentication mechamisms. All |
| 565 | entries are always present if any mechanism is declared, but the functions are |
| 566 | set to NULL for those that are not compiled into the binary. */ |
| 567 | |
| 568 | #ifdef AUTH_CRAM_MD5 |
| 569 | #include "auths/cram_md5.h" |
| 570 | #endif |
| 571 | |
| 572 | #ifdef AUTH_CYRUS_SASL |
| 573 | #include "auths/cyrus_sasl.h" |
| 574 | #endif |
| 575 | |
| 576 | #ifdef AUTH_DOVECOT |
| 577 | #include "auths/dovecot.h" |
| 578 | #endif |
| 579 | |
| 580 | #ifdef AUTH_PLAINTEXT |
| 581 | #include "auths/plaintext.h" |
| 582 | #endif |
| 583 | |
| 584 | #ifdef AUTH_SPA |
| 585 | #include "auths/spa.h" |
| 586 | #endif |
| 587 | |
| 588 | auth_info auths_available[] = { |
| 589 | |
| 590 | /* Checking by an expansion condition on plain text */ |
| 591 | |
| 592 | #ifdef AUTH_CRAM_MD5 |
| 593 | { |
| 594 | US"cram_md5", /* lookup name */ |
| 595 | auth_cram_md5_options, |
| 596 | &auth_cram_md5_options_count, |
| 597 | &auth_cram_md5_option_defaults, |
| 598 | sizeof(auth_cram_md5_options_block), |
| 599 | auth_cram_md5_init, /* init function */ |
| 600 | auth_cram_md5_server, /* server function */ |
| 601 | auth_cram_md5_client /* client function */ |
| 602 | }, |
| 603 | #endif |
| 604 | |
| 605 | #ifdef AUTH_CYRUS_SASL |
| 606 | { |
| 607 | US"cyrus_sasl", /* lookup name */ |
| 608 | auth_cyrus_sasl_options, |
| 609 | &auth_cyrus_sasl_options_count, |
| 610 | &auth_cyrus_sasl_option_defaults, |
| 611 | sizeof(auth_cyrus_sasl_options_block), |
| 612 | auth_cyrus_sasl_init, /* init function */ |
| 613 | auth_cyrus_sasl_server, /* server function */ |
| 614 | NULL /* client function */ |
| 615 | }, |
| 616 | #endif |
| 617 | |
| 618 | #ifdef AUTH_DOVECOT |
| 619 | { |
| 620 | US"dovecot", /* lookup name */ |
| 621 | auth_dovecot_options, |
| 622 | &auth_dovecot_options_count, |
| 623 | &auth_dovecot_option_defaults, |
| 624 | sizeof(auth_dovecot_options_block), |
| 625 | auth_dovecot_init, /* init function */ |
| 626 | auth_dovecot_server, /* server function */ |
| 627 | NULL /* client function */ |
| 628 | }, |
| 629 | #endif |
| 630 | |
| 631 | #ifdef AUTH_PLAINTEXT |
| 632 | { |
| 633 | US"plaintext", /* lookup name */ |
| 634 | auth_plaintext_options, |
| 635 | &auth_plaintext_options_count, |
| 636 | &auth_plaintext_option_defaults, |
| 637 | sizeof(auth_plaintext_options_block), |
| 638 | auth_plaintext_init, /* init function */ |
| 639 | auth_plaintext_server, /* server function */ |
| 640 | auth_plaintext_client /* client function */ |
| 641 | }, |
| 642 | #endif |
| 643 | |
| 644 | #ifdef AUTH_SPA |
| 645 | { |
| 646 | US"spa", /* lookup name */ |
| 647 | auth_spa_options, |
| 648 | &auth_spa_options_count, |
| 649 | &auth_spa_option_defaults, |
| 650 | sizeof(auth_spa_options_block), |
| 651 | auth_spa_init, /* init function */ |
| 652 | auth_spa_server, /* server function */ |
| 653 | auth_spa_client /* client function */ |
| 654 | }, |
| 655 | #endif |
| 656 | |
| 657 | { US"", NULL, NULL, NULL, 0, NULL, NULL, NULL } |
| 658 | }; |
| 659 | |
| 660 | |
| 661 | /* Tables of information about which routers and transports are included in the |
| 662 | exim binary. */ |
| 663 | |
| 664 | /* Pull in the necessary header files */ |
| 665 | |
| 666 | #include "routers/rf_functions.h" |
| 667 | |
| 668 | #ifdef ROUTER_ACCEPT |
| 669 | #include "routers/accept.h" |
| 670 | #endif |
| 671 | |
| 672 | #ifdef ROUTER_DNSLOOKUP |
| 673 | #include "routers/dnslookup.h" |
| 674 | #endif |
| 675 | |
| 676 | #ifdef ROUTER_MANUALROUTE |
| 677 | #include "routers/manualroute.h" |
| 678 | #endif |
| 679 | |
| 680 | #ifdef ROUTER_IPLITERAL |
| 681 | #include "routers/ipliteral.h" |
| 682 | #endif |
| 683 | |
| 684 | #ifdef ROUTER_IPLOOKUP |
| 685 | #include "routers/iplookup.h" |
| 686 | #endif |
| 687 | |
| 688 | #ifdef ROUTER_QUERYPROGRAM |
| 689 | #include "routers/queryprogram.h" |
| 690 | #endif |
| 691 | |
| 692 | #ifdef ROUTER_REDIRECT |
| 693 | #include "routers/redirect.h" |
| 694 | #endif |
| 695 | |
| 696 | #ifdef TRANSPORT_APPENDFILE |
| 697 | #include "transports/appendfile.h" |
| 698 | #endif |
| 699 | |
| 700 | #ifdef TRANSPORT_AUTOREPLY |
| 701 | #include "transports/autoreply.h" |
| 702 | #endif |
| 703 | |
| 704 | #ifdef TRANSPORT_LMTP |
| 705 | #include "transports/lmtp.h" |
| 706 | #endif |
| 707 | |
| 708 | #ifdef TRANSPORT_PIPE |
| 709 | #include "transports/pipe.h" |
| 710 | #endif |
| 711 | |
| 712 | #ifdef TRANSPORT_SMTP |
| 713 | #include "transports/smtp.h" |
| 714 | #endif |
| 715 | |
| 716 | |
| 717 | /* Now set up the structures, terminated by an entry with a null name. */ |
| 718 | |
| 719 | router_info routers_available[] = { |
| 720 | #ifdef ROUTER_ACCEPT |
| 721 | { |
| 722 | US"accept", |
| 723 | accept_router_options, |
| 724 | &accept_router_options_count, |
| 725 | &accept_router_option_defaults, |
| 726 | sizeof(accept_router_options_block), |
| 727 | accept_router_init, |
| 728 | accept_router_entry, |
| 729 | NULL, /* no tidyup entry */ |
| 730 | ri_yestransport |
| 731 | }, |
| 732 | #endif |
| 733 | #ifdef ROUTER_DNSLOOKUP |
| 734 | { |
| 735 | US"dnslookup", |
| 736 | dnslookup_router_options, |
| 737 | &dnslookup_router_options_count, |
| 738 | &dnslookup_router_option_defaults, |
| 739 | sizeof(dnslookup_router_options_block), |
| 740 | dnslookup_router_init, |
| 741 | dnslookup_router_entry, |
| 742 | NULL, /* no tidyup entry */ |
| 743 | ri_yestransport |
| 744 | }, |
| 745 | #endif |
| 746 | #ifdef ROUTER_IPLITERAL |
| 747 | { |
| 748 | US"ipliteral", |
| 749 | ipliteral_router_options, |
| 750 | &ipliteral_router_options_count, |
| 751 | &ipliteral_router_option_defaults, |
| 752 | sizeof(ipliteral_router_options_block), |
| 753 | ipliteral_router_init, |
| 754 | ipliteral_router_entry, |
| 755 | NULL, /* no tidyup entry */ |
| 756 | ri_yestransport |
| 757 | }, |
| 758 | #endif |
| 759 | #ifdef ROUTER_IPLOOKUP |
| 760 | { |
| 761 | US"iplookup", |
| 762 | iplookup_router_options, |
| 763 | &iplookup_router_options_count, |
| 764 | &iplookup_router_option_defaults, |
| 765 | sizeof(iplookup_router_options_block), |
| 766 | iplookup_router_init, |
| 767 | iplookup_router_entry, |
| 768 | NULL, /* no tidyup entry */ |
| 769 | ri_notransport |
| 770 | }, |
| 771 | #endif |
| 772 | #ifdef ROUTER_MANUALROUTE |
| 773 | { |
| 774 | US"manualroute", |
| 775 | manualroute_router_options, |
| 776 | &manualroute_router_options_count, |
| 777 | &manualroute_router_option_defaults, |
| 778 | sizeof(manualroute_router_options_block), |
| 779 | manualroute_router_init, |
| 780 | manualroute_router_entry, |
| 781 | NULL, /* no tidyup entry */ |
| 782 | 0 |
| 783 | }, |
| 784 | #endif |
| 785 | #ifdef ROUTER_QUERYPROGRAM |
| 786 | { |
| 787 | US"queryprogram", |
| 788 | queryprogram_router_options, |
| 789 | &queryprogram_router_options_count, |
| 790 | &queryprogram_router_option_defaults, |
| 791 | sizeof(queryprogram_router_options_block), |
| 792 | queryprogram_router_init, |
| 793 | queryprogram_router_entry, |
| 794 | NULL, /* no tidyup entry */ |
| 795 | 0 |
| 796 | }, |
| 797 | #endif |
| 798 | #ifdef ROUTER_REDIRECT |
| 799 | { |
| 800 | US"redirect", |
| 801 | redirect_router_options, |
| 802 | &redirect_router_options_count, |
| 803 | &redirect_router_option_defaults, |
| 804 | sizeof(redirect_router_options_block), |
| 805 | redirect_router_init, |
| 806 | redirect_router_entry, |
| 807 | NULL, /* no tidyup entry */ |
| 808 | ri_notransport |
| 809 | }, |
| 810 | #endif |
| 811 | { US"", NULL, NULL, NULL, 0, NULL, NULL, NULL, 0 } |
| 812 | }; |
| 813 | |
| 814 | |
| 815 | |
| 816 | transport_info transports_available[] = { |
| 817 | #ifdef TRANSPORT_APPENDFILE |
| 818 | { |
| 819 | US"appendfile", /* driver name */ |
| 820 | appendfile_transport_options, /* local options table */ |
| 821 | &appendfile_transport_options_count, /* number of entries */ |
| 822 | &appendfile_transport_option_defaults, /* private options defaults */ |
| 823 | sizeof(appendfile_transport_options_block), /* size of private block */ |
| 824 | appendfile_transport_init, /* init entry point */ |
| 825 | appendfile_transport_entry, /* main entry point */ |
| 826 | NULL, /* no tidyup entry */ |
| 827 | NULL, /* no closedown entry */ |
| 828 | TRUE, /* local flag */ |
| 829 | }, |
| 830 | #endif |
| 831 | #ifdef TRANSPORT_AUTOREPLY |
| 832 | { |
| 833 | US"autoreply", /* driver name */ |
| 834 | autoreply_transport_options, /* local options table */ |
| 835 | &autoreply_transport_options_count, /* number of entries */ |
| 836 | &autoreply_transport_option_defaults, /* private options defaults */ |
| 837 | sizeof(autoreply_transport_options_block), /* size of private block */ |
| 838 | autoreply_transport_init, /* init entry point */ |
| 839 | autoreply_transport_entry, /* main entry point */ |
| 840 | NULL, /* no tidyup entry */ |
| 841 | NULL, /* no closedown entry */ |
| 842 | TRUE /* local flag */ |
| 843 | }, |
| 844 | #endif |
| 845 | #ifdef TRANSPORT_LMTP |
| 846 | { |
| 847 | US"lmtp", /* driver name */ |
| 848 | lmtp_transport_options, /* local options table */ |
| 849 | &lmtp_transport_options_count, /* number of entries */ |
| 850 | &lmtp_transport_option_defaults, /* private options defaults */ |
| 851 | sizeof(lmtp_transport_options_block), /* size of private block */ |
| 852 | lmtp_transport_init, /* init entry point */ |
| 853 | lmtp_transport_entry, /* main entry point */ |
| 854 | NULL, /* no tidyup entry */ |
| 855 | NULL, /* no closedown entry */ |
| 856 | TRUE /* local flag */ |
| 857 | }, |
| 858 | #endif |
| 859 | #ifdef TRANSPORT_PIPE |
| 860 | { |
| 861 | US"pipe", /* driver name */ |
| 862 | pipe_transport_options, /* local options table */ |
| 863 | &pipe_transport_options_count, /* number of entries */ |
| 864 | &pipe_transport_option_defaults, /* private options defaults */ |
| 865 | sizeof(pipe_transport_options_block), /* size of private block */ |
| 866 | pipe_transport_init, /* init entry point */ |
| 867 | pipe_transport_entry, /* main entry point */ |
| 868 | NULL, /* no tidyup entry */ |
| 869 | NULL, /* no closedown entry */ |
| 870 | TRUE /* local flag */ |
| 871 | }, |
| 872 | #endif |
| 873 | #ifdef TRANSPORT_SMTP |
| 874 | { |
| 875 | US"smtp", /* driver name */ |
| 876 | smtp_transport_options, /* local options table */ |
| 877 | &smtp_transport_options_count, /* number of entries */ |
| 878 | &smtp_transport_option_defaults, /* private options defaults */ |
| 879 | sizeof(smtp_transport_options_block), /* size of private block */ |
| 880 | smtp_transport_init, /* init entry point */ |
| 881 | smtp_transport_entry, /* main entry point */ |
| 882 | NULL, /* no tidyup entry */ |
| 883 | smtp_transport_closedown, /* close down passed channel */ |
| 884 | FALSE /* local flag */ |
| 885 | }, |
| 886 | #endif |
| 887 | { US"", NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, FALSE } |
| 888 | }; |
| 889 | |
| 890 | /* End of drtables.c */ |