7

I am moving servers, both of them running Debian (oldstable and stable). Both are running Exim4. When I switch the DNS entries over to the new server, I'd like the old server to still forward incoming mail to my new server for processing, so that users do not see any outage. How can I do this?

3 Answers 3

8

Just replace all routers by one manualroute that points directly to the new MX:

begin routers redir: driver = manualroute domains = * transport = remote_smtp route_list = * 12.34.56.78 

Here 12.34.56.78 - is an IP-address of your new MX where all messages should go.

3
  • Seems like one way to do this. Thanks. One comment: Since I am dealing with Debian, maybe it's enough if I set the dc_smarthost variable in the update-exim4.conf.conf? Can anyone comment on that? Commented Jan 2, 2014 at 18:26
  • Tried the dc_smarthost, and no, it does not suffice. Commented Jan 9, 2014 at 17:10
  • Tested your router now, it works great. Commented Jan 9, 2014 at 19:05
2

You can use the .forward files and/or redirection mechanisms as documented and illustrated here.

An example of the forward file from the above link is:

Sam.Reman, [email protected] 
0

If you're on Debian, you can use hubbed_hosts. From the exim4-config_files man page:

/etc/exim4/hubbed_hosts [exim domain list] is an optional file containing a list of route_data records which can be used to override or augment MX information from the DNS. This is particularly useful for mail hubs which are highest-priority MX for a domain in the DNS but are not final destination of the messages, passing them on to a host which is not publicly reachable, or to temporarily fix mail routing in case of broken DNS setups. The file should contain key-value pairs of domain pattern and route data of the form domain: host-list options dict.ref.example: mail-1.ref.example:mail-2.ref.example foo.example: internal.mail.example.com bar.example: 192.168.183.3 which will cause mail for foo.example to be sent to the host internal.mail.example (IP address de‐ rived from A record only), and mail to bar.example to be sent to 192.168.183.3. See spec.txt chapter 20.3 through 20.7 for a more detailed explanation of host list format and available options. 

So in your case, in /etc/exim4/hubbed_hosts on your old server, you'd put

mydomain.com: newserver.newdomain.com myotherdomain.com newserver.newdomain.com 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.