Testsuite: move dsearch-dependent testcase
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 22 Mar 2020 11:13:49 +0000 (11:13 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 22 Mar 2020 11:13:49 +0000 (11:13 +0000)
test/aux-fixed/2501.alias.exists [new file with mode: 0644]
test/confs/0153
test/confs/2501
test/scripts/2500-dsearch/2501
test/stdout/2501

diff --git a/test/aux-fixed/2501.alias.exists b/test/aux-fixed/2501.alias.exists
new file mode 100644 (file)
index 0000000..2bd57ca
--- /dev/null
@@ -0,0 +1 @@
+yes: aliased@okdomain
index 24f499b41f1603723632326dd22d23ebfa2c9d3b..35a004a455a859f1443874ed74d80af95df9fd2e 100644 (file)
@@ -13,9 +13,10 @@ begin routers
 virtual:
   driver = redirect
   domains = *.virt.test.ex
-  address_data = ${lookup {TESTNUM.alias.${extract {1}{.}{$domain}}} \
-                       dsearch{DIR/aux-fixed} {$value}fail}
-  data = ${lookup{$local_part}lsearch{DIR/aux-fixed/$address_data}}
+  address_data = ${if match{$domain}{^(.*)\\.virt\\.test\\.ex\$}{${bless:$1}}}
+  data = ${if exists{DIR/aux-fixed/TESTNUM.alias.$address_data} \
+           {${lookup{$local_part}lsearch{DIR/aux-fixed/TESTNUM.alias.$address_data}}} \
+          fail}
   no_more
 
 list:
index b485b010290af56675785a7314006725d5bcfd0a..61bf7383bc7140699fc1ee25dc0163acf762e46f 100644 (file)
@@ -14,10 +14,17 @@ domainlist local_domains = dsearch;DIR/aux-fixed/TESTNUM.domains
 begin routers
 
 r1:
-  driver = accept
-  domains = +local_domains
-  transport = t1
-
+  driver =     accept
+  domains =    +local_domains
+  transport =  t1
+
+virtual:
+  driver =     redirect
+  domains =    *.virt.test.ex
+  address_data = ${lookup {TESTNUM.alias.${extract {1}{.}{$domain}}} \
+                       dsearch{DIR/aux-fixed} {$value}fail}
+  data =       ${lookup{$local_part}lsearch{DIR/aux-fixed/$address_data}}
+  no_more
 
 # ------ Transports ------
 
index 44b5308eb939a23de251b06a194051c60ecce495..d3b31a668a8b593ac4ab81f51ee7a52c85dd119d 100644 (file)
@@ -2,3 +2,6 @@
 2
 exim -bt xxx@okdomain yyy@notokdomain zzz@dom/mod
 ****
+2
+exim -bv yes@exists.virt.test.ex no@exists.virt.test.ex xx@notexists.virt.test.ex
+****
index 1199cdd1d3b13d2c299e84688bdfc477f6771881..2534665639684c76e0047735de69096293ac6e26 100644 (file)
@@ -2,3 +2,6 @@ xxx@okdomain
   router = r1, transport = t1
 yyy@notokdomain is undeliverable: Unrouteable address
 syntax error: malformed address: /mod may not follow zzz@dom
+yes@exists.virt.test.ex verified
+no@exists.virt.test.ex failed to verify: Unrouteable address
+xx@notexists.virt.test.ex failed to verify: Unrouteable address