200_exim4-config_primary 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ### router/200_exim4-config_primary
  2. #################################
  3. # This file holds the primary router, responsible for nonlocal mails
  4. .ifdef DCconfig_internet
  5. # configtype=internet
  6. #
  7. # deliver mail to the recipient if recipient domain is a domain we
  8. # relay for. We do not ignore any target hosts here since delivering to
  9. # a site local or even a link local address might be wanted here, and if
  10. # such an address has found its way into the MX record of such a domain,
  11. # the local admin is probably in a place where that broken MX record
  12. # could be fixed.
  13. dnslookup_relay_to_domains:
  14. debug_print = "R: dnslookup_relay_to_domains for $local_part@$domain"
  15. driver = dnslookup
  16. domains = ! +local_domains : +relay_to_domains
  17. transport = remote_smtp
  18. same_domain_copy_routing = yes
  19. no_more
  20. # deliver mail directly to the recipient. This router is only reached
  21. # for domains that we do not relay for. Since we most probably can't
  22. # have broken MX records pointing to site local or link local IP
  23. # addresses fixed, we ignore target hosts pointing to these addresses.
  24. dnslookup:
  25. debug_print = "R: dnslookup for $local_part@$domain"
  26. driver = dnslookup
  27. domains = ! +local_domains
  28. transport = remote_smtp
  29. same_domain_copy_routing = yes
  30. # ignore private rfc1918 and APIPA addresses
  31. ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :\
  32. 172.16.0.0/12 : 10.0.0.0/8 : 169.254.0.0/16 :\
  33. 255.255.255.255
  34. no_more
  35. .endif
  36. .ifdef DCconfig_local
  37. # configtype=local
  38. #
  39. # Stand-alone system, so generate an error for mail to a non-local domain
  40. nonlocal:
  41. debug_print = "R: nonlocal for $local_part@$domain"
  42. driver = redirect
  43. domains = ! +local_domains
  44. allow_fail
  45. data = :fail: Mailing to remote domains not supported
  46. no_more
  47. .endif
  48. .ifdef DCconfig_smarthost DCconfig_satellite
  49. # configtype=smarthost or configtype=satellite
  50. #
  51. # Send all non-local mail to a single other machine (smarthost).
  52. #
  53. # This means _ALL_ non-local mail goes to the smarthost. This will most
  54. # probably not do what you want for domains that are listed in
  55. # relay_domains. The most typical use for relay_domains is to control
  56. # relaying for incoming e-mail on secondary MX hosts. In that case,
  57. # it doesn't make sense to send the mail to the smarthost since the
  58. # smarthost will probably send the message right back here, causing a
  59. # loop.
  60. #
  61. # If you want to use a smarthost while being secondary MX for some
  62. # domains, you'll need to copy the dnslookup_relay_to_domains router
  63. # here so that mail to relay_domains is handled separately.
  64. smarthost:
  65. debug_print = "R: smarthost for $local_part@$domain"
  66. driver = manualroute
  67. domains = ! +local_domains
  68. transport = remote_smtp_smarthost
  69. route_list = * DCsmarthost byname
  70. host_find_failed = ignore
  71. same_domain_copy_routing = yes
  72. no_more
  73. .endif
  74. # The "no_more" above means that all later routers are for
  75. # domains in the local_domains list, i.e. just like Exim 3 directors.