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