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