Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am running Exim 4.71. I want to:

  1. Route all email from through
  2. Route all email from [B-E].com through
  3. Send all other email directly.

Here is the configuration I have that doesn't work like I hoped:

domainlist a_domains =
domainlist b_domains = : : :

begin routers

  driver = manualroute
  domains = +a_domains
  transport = remote_smtp
  route_list = +a_domains

  driver = manualroute
  domains = +b_domains
  transport = remote_smtp
  route_list = +b_domains

  driver = dnslookup
  domains = ! +local_domains
  transport = remote_smtp
  ignore_target_hosts = :

When I send an email e.g. with PHP's mail() or Zend_Mail_Transport_Smtp setting both From: and Return-Path: as, the smart_route_a router is not used, the dnslookup is used instead. Disabling dnslookup results in no mail being sent.

From the logs it appears that email sent to uses smart_route_a, but the same email sent from to is sent using dnslookup.

How do I make email from be relayed via

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Use a conditional like

route_list = * "${if match{$header_from:}{\N.*\.a\.com$\N} {}}"

domains = only checks the destination domain not the source domain.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.