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