divmap.m4, lists.m4, vhost.m4: End-stop for required local parts.
[exim-config] / vhost.m4
index 4ac677b..96b7505 100644 (file)
--- a/vhost.m4
+++ b/vhost.m4
@@ -30,7 +30,6 @@ m4_define(<:VHOST_FILTER:>,
        VHOST
        condition = DOMKV($2, {true}{false})
        router_home_directory = DOMKV(home, {$value} fail)
-       more = ${if bool{DOMKV(final, {$value}{true})} {false} {true}}
        $1 = ${expand:DOMKV($2)}:>)
 m4_define(<:VHOST_USER:>,
        <:user = DOMKV(owner, {$value}{CONF_filter_user})
@@ -63,5 +62,24 @@ FILTER_ROUTER(virtual_file,
        <:VHOST_FILTER(file, filter):>,, <:
        VHOST_USER:>)
 
+SECTION(routers, virtual-tail)m4_dnl
+## Last ditch effort for required local parts.  This is a bit strange because
+## we should only try this for `final' domains -- where we're not going to
+## route using the system-wide rules -- and we want the router to decline if
+## the local part isn't one of our required set so that routing as a whole
+## fails.
+virtual_endstop:
+       VHOST
+       condition = DOMKV(final, {$value}{true})
+       driver = redirect
+       no_more
+       data = ${if match_local_part{$local_part}{+required} \
+                   {DOMKV(errors_to, \
+                          {$value} \
+                          {DOMKV(owner, \
+                                 {$value} \
+                                 {postmaster})})} \
+                   {:unknown:}}
+
 DIVERT(null)
 ###----- That's all, folks --------------------------------------------------