FAQ / Routing to remote hosts / Q0309
| /Q0301 /Q0302 /Q0303 /Q0304 /Q0305 /Q0306 /Q0307 /Q0308 /Q0309 /Q0310 /Q0311 /Q0312 /Q0313 /Q0314 /Q0315 /Q0316 /Q0317 /Q0318 /Q0319 /Q0320 /Q0321 /Q0322 |
Q0309
Question
How can I configure Exim on a firewall machine so that if mail arrives addressed to a domain whose MX points to the firewall, it is forwarded to the internal mail server, without having to have a list of all the domains involved?
Answer
As your first router, have the standard dnslookup router from the default configuration, with the added option
self = pass
This will handle all domains whose lowest numbered MX records do not point to your host. Because of the no_more setting, if it encounters an unknown domain, routing will fail. However, if it hits a domain whose lowest numbered MX points to your host, the self option comes into play, and overrides no_more. The pass setting causes it to pass the address on to the next router. (The default causes it to generate an error.) The only non-local domains that reach the second router are those with MX records pointing to the local host. Set it up to send them to the internal mail server like this:
internal: driver = manualroute domains = ! +local_domains transport = remote_smtp route_list = * internal.server
| /Q0301 /Q0302 /Q0303 /Q0304 /Q0305 /Q0306 /Q0307 /Q0308 /Q0309 /Q0310 /Q0311 /Q0312 /Q0313 /Q0314 /Q0315 /Q0316 /Q0317 /Q0318 /Q0319 /Q0320 /Q0321 /Q0322 |
FAQ / Routing to remote hosts / Q0309
