Q0205

Ali Vakilzade edited this page Aug 13, 2014 · 3 revisions
Clone this wiki locally

Q0205

Question

How can I get Exim to deliver to me locally and everyone else at the same domain via SMTP to the MX record specified host?

Answer

Create an accept router to pick off the one address and pass it to an appropriate transport. Put this router before the one that does MX routing:

me:
  driver = accept
  domains = dom.com
  local_parts = me
  transport = local_delivery

In the transport you will have to specify the user option. An alternative way of doing this is to add a condition to the router that does MX lookups to make it skip your address. Subsequent routers can then deliver your address locally. You'll need a condition like this:

condition = \
  ${if and {{eq{$domain}{dom.com}}{eq{$local_part}{me{no}{yes}}}}}