Exim Specification - 27. Additional generic options for routers

Go to the first, previous, next, last section, table of contents.

# 27. Additional generic options for routers

The following additional generic options apply to all routers, in addition to the common generic options for both directors and routers which are described in chapter 20. Routers are concerned with addresses whose domains do not match something in local_domains.

### ignore_target_hosts (router)

Type: host list, expanded
Default: unset

Although this option is a host list, it would normally contain IP address entries rather than names. If any host that is looked up by the router matches an item in this list, Exim behaves as if the host did not exist. This option allows you to cope with rogue DNS entries like

    some.remote.domain  A  127.0.0.1

by setting

    ignore_target_hosts = 127.0.0.1

on the relevant router. Attempts to mail to such a domain then receive the `unrouteable domain' error, and verifications fail. This option may also be useful for ignoring link local IPv6 addresses. The string value of ignore_target_hosts is expanded before use as a list, so it is possible to make it dependent on the domain that is being routed.

### pass_on_timeout (router)

Type: boolean
Default: false

If a router times out during a host lookup, it normally causes deferral of the address. If pass_on_timeout is set, the address is instead passed on to the next router, overriding no_more. This may be helpful for systems that are intermittently connected to the Internet, or those that want to pass to a smart host any messages that cannot immediately be delivered.

There are occasional other temporary errors that can occur while doing DNS lookups. They are treated in the same way as a timeout, and this option applies to all of them.

### self (router)

Type: string
Default: "freeze"

This option specifies what is to happen if routing a remote address ends up pointing at the local host, or at a host whose name matches hosts_treat_as_local. Normally this indicates either an error in Exim's configuration (for example, the domain should be listed as local), or an error in the DNS (for example, the MX shouldn't point at this host). However, this situation is not confined to the use of MX records, and the self option can be used on any router.

The default action is to freeze the message. The following alternatives are provided for use in special cases:

- defer
  Delivery of the message is tried again later.
- reroute: <domain>
  The domain is changed to the given domain, and the address is passed back to be reprocessed by the directors and routers. No rewriting of headers takes place.
- reroute: rewrite: <domain>
  The domain is changed to the given domain, and the address is passed back to be reprocessed by the directors and routers. Any headers that contain the original domain are rewritten.
- local
  The address is passed to the directors, as if its domain were a local domain, even though it does not match anything in local_domains. This can be used to treat all domains whose lowest MX records point to the host as local domains. During subsequent directing and delivery the variable $self_hostname is set to the name of the local host that the router encountered. This can be used to distinguish between different cases for hosts with multiple names.
- pass
  The router declines, passing the address to the following router, and overriding no_more. During subsequent routing and delivery, the variable $self_hostname contains the name of the local host that the router encountered. This can be used to distinguish between different cases for hosts with multiple names. A combination of pass and no_more ensures that only those addresses that routed to the local host are passed on. Without no_more, addresses that were declined for other reasons would also be passed to the next router. In earlier versions of Exim fail_soft was used instead of pass. It will remain as a synonym for some time.
- fail
  The router declines, but the address is not passed to any following routers. Consequently, delivery fails and an error report is generated. In earlier versions of Exim fail_hard was used instead of fail. It will remain as a synonym for some time.
- send
  The anomaly is ignored and the message is transmitted anyway. This setting should be used with extreme caution. It makes sense only in cases where the program that is listening on the SMTP port is not this version of Exim. That is, it must be some other MTA, or Exim with a different configuration file that handles the domain in another way.

When a router just rewrites, that is, does not set up IP addresses, the self option is not relevant.

### translate_ip_address (router)

Type: string, expanded
Default: unset

There exist some rare networking situations (for example, packet radio) where it is helpful to be able to translate IP addresses generated by normal routing mechanisms into other IP addresses, thus performing a kind of manual IP routing. This should be done only if the normal IP routing of the TCP/IP stack is inadequate or broken. Because this is an extremely uncommon requirement, the code to support this option is not included in the Exim binary unless SUPPORT_TRANSLATE_IP_ADDRESS=yes is set in ``Local/Makefile'`.

The translate_ip_address string is expanded for every IP address generated by the router, with the generated address set in $host_address. If the expansion is forced to fail, no action is taken. If it returns an IP address, that replaces the original address; otherwise the result is assumed to be a host name -- this is looked up using gethostbyname() to produce one or more replacement IP addresses. For example, to subvert all IP addresses in some specific networks, this could be added to a router:

    $smc{translate_ip_address = \
      ${lookup{${mask:$host_address/26}}lsearch{/some/file}{$value}fail}}

The file would contain lines like

    10.2.3.128/26    some.host
    10.8.4.34/26     10.44.8.15

You should not make use of this facility unless you really understand what you are doing.

Go to the first, previous, next, last section, table of contents.