# Exim test configuration 0134

.include DIR/aux-var/std_conf_prefix


# ----- Main settings -----

domainlist local_domains = test.ex: *.test.ex
qualify_domain = test.ex


# ----- Routers -----

begin routers

topipe:
  driver = accept
  caseful_local_part
  retry_use_local_part
  domains = pipe.domain
  local_parts = PIPE
  transport = pipe

domainlist:
  driver = manualroute
  caseful_local_part
  domains = lsearch;DIR/aux-fixed/TESTNUM.listR
  headers_add = "domainlist: dd=$domain_data lpd=$local_part_data"
  local_parts = lsearch;DIR/aux-fixed/TESTNUM.listR
  route_list = *
  transport = appendfile

default1:
  driver = manualroute
  domains = ! +local_domains
  route_list = *
  transport = appendfile
  no_more

smartuser:
  driver = accept
  domains = lsearch;DIR/aux-fixed/TESTNUM.listD
  headers_add = "smartuser: dd=$domain_data lpd=$local_part_data"
  local_parts = lsearch;DIR/aux-fixed/TESTNUM.listD
  retry_use_local_part
  transport = appendfile

default2:
  driver = accept
  headers_add = router: defaulted
  retry_use_local_part
  transport = appendfile


# ----- Transports -----

begin transports

# We want local parts with different casing to be different, but this goes
# wrong on file systems that are not case-dependent. So fudge the file names
# by steam - an lsearch lookup is no good because it is case-independent.

appendfile:
  driver = appendfile
  user = CALLER
  headers_add = "domain_data: $domain_data\n\
                 local_part_data: $local_part_data"
  file = DIR/test-mail/\
         ${if eq {$local_part}{unknown}{lc-unknown}{\
         ${if eq {$local_part}{USERX}{UC-USERX}{\
         ${if eq {$local_part}{userx}{lc-userx}{\
         $local_part}}}}}}

pipe:
  driver = pipe
  command = /bin/sh -c "echo $local_part $domain >DIR/test-mail/$local_part"
  user = CALLER


# ----- Retry -----


begin retry

* * F,1d,15m


# End