0

Is it possible to configure a Linux mail server (we're running exim) to forward unhandled emails to another server? Here's an example of what I'm trying to accomplish:

  • an email get's send to [email protected]
  • the MX record for domain.com points to server1 so the email goes to server1
  • if server1 doesn't have an email forward or mailbox for [email protected] it forwards the email to server2 that receives the email as if it was originally sent to it (as if the MX record pointed to server2 directly)

Is something like this possible? If it is, any information you can provide on how to accomplish this is highly appreciated.

Thanks.

3
  • What problem are you trying to solve, there may be a better way to do it.
    – DanBig
    Jul 23, 2013 at 16:24
  • With postfix it could be done with luser_relay = [email protected] . I think exim have a similar solution
    – ALex_hha
    Jul 23, 2013 at 16:33
  • 1
    You're looking to implement a shared SMTP namespace. I can't tell you how to do that with anything other than Exchange Server, but if you Google that term you should get plenty of results.
    – joeqwerty
    Jul 23, 2013 at 17:38

1 Answer 1

0

It could be done with a router placed after all the routers that match local users.

An alternative would be to put a callout router early in the list that calls out to the second server and accepts mail if the user exist there. This would be my preference.

Routing would be:

  • Route to second server if address exists there.
  • Route locally for local addresses.
  • Reject.

EDIT Something like this should forward all unhandled mail for local domains to notlocal.host.ref.example. Mail for root is not forwarded. This router has not been verified, and does not handle address validation. You may need to remove the cannot_route_messages from a prior router.

  notlocal:
   driver = manualroute
   transport = remote_smtp
   domains = +local_domains
   route_list = +local_domains  notlocal.host.ref.example
   local_parts = ! root
   cannot_route_message = Unknown user

Basically this is the final delivery router with the transport changed and check_local_user removed. Test before using.

2
  • Thanks. could you suggest which exim router could do this (and possibly how to configure it)? I'm especially interested in the first suggestion (place the router after all the local users are matched) since it would work best for this unusual setup we're creating. Jul 24, 2013 at 4:16
  • @HarryMuscle I believe the manualroute router will do what you want. I've added an unverified example.
    – BillThor
    Jul 24, 2013 at 5:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .