Change how filtering routers work.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 5 Mar 2014 17:36:22 +0000 (17:36 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 5 Mar 2014 17:46:49 +0000 (17:46 +0000)
Commit e7b830e7... was overzealous.  In particular, it took the
`alias' router from working.  Take out `verify = false' from the
`FILTER_TRANSPORT' options, and replace this with a macro
`FILTER_ROUTER' which generates a verify/delivery router pair with the
right stuff in.

This change also introduces verification-time processing for
`~/.mail/forward' and `~/.forward' files, since that's easy and
possibly useful.

base.m4
local.m4
vhost.m4

diff --git a/base.m4 b/base.m4
index 0827835..f8b2901 100644 (file)
--- a/base.m4
+++ b/base.m4
@@ -242,12 +242,20 @@ m4_define(<:FILTER_VERIFY:>,
 
 ## Transports for redirection filters.
 m4_define(<:FILTER_TRANSPORTS:>,
-       <:verify = false
-       file_transport = mailbox
+       <:file_transport = mailbox
        directory_transport = maildir
        pipe_transport = pipe
        reply_transport = reply:>)
 
+m4_define(<:FILTER_ROUTER:>,
+<:$1_vrf:
+       $2
+       FILTER_VERIFY<::>$3
+$1:
+       $2
+       verify = no
+       FILTER_TRANSPORTS<::>$4:>)
+
 DIVERT(null)
 ###--------------------------------------------------------------------------
 ### Some standard transports.
index 7abf456..52398aa 100644 (file)
--- a/local.m4
+++ b/local.m4
@@ -87,20 +87,13 @@ SECTION(routers, forward)m4_dnl
 ## rejection if possible).  Mail sent directly to the user is handled through
 ## `~/.mail/forward', or `~/.forward', or if neither of those exists, by
 ## writing the message to `/var/mail/USER'.
-filter_verify:
-       FILTER_LOCALUSER(CONF_userconf_dir/forward.suffix)
-       FILTER_VERIFY
-       local_part_suffix = CONF_user_suffix_list
-filter_suffix:
-       FILTER_LOCALUSER(CONF_userconf_dir/forward.suffix)
-       local_part_suffix = CONF_user_suffix_list
-       FILTER_TRANSPORTS
-filter:
-       FILTER_LOCALUSER(CONF_userconf_dir/forward)
-       FILTER_TRANSPORTS
-dot_forward:
-       FILTER_LOCALUSER($home/.forward)
-       FILTER_TRANSPORTS
+FILTER_ROUTER(filter_suffix,
+       <:FILTER_LOCALUSER(CONF_userconf_dir/forward.suffix)
+       local_part_suffix = CONF_user_suffix_list:>)
+FILTER_ROUTER(filter,
+       <:FILTER_LOCALUSER(CONF_userconf_dir/forward):>)
+FILTER_ROUTER(dot_forward,
+       <:FILTER_LOCALUSER($home/.forward):>)
 
 SECTION(routers, deliver)m4_dnl
 ## Deliver mail to a user, in the absence of any other instructions.
index 603b238..6a710cb 100644 (file)
--- a/vhost.m4
+++ b/vhost.m4
@@ -55,21 +55,12 @@ SECTION(routers, virtual)m4_dnl
 ## Remap recipients according to the virtual host's instructions.  This must
 ## be done in two passes, so that we can identify the correct user's spam
 ## threshold during address verification.
-virtual_verify_data:
-       VHOST_FILTER(redirect, data)
-       FILTER_VERIFY
-virtual_verify_file:
-       VHOST_FILTER(filter, file)
-       FILTER_VERIFY
-
-virtual_filter_data:
-       VHOST_FILTER(redirect, data)
-       VHOST_USER
-       FILTER_TRANSPORTS
-virtual_filter_file:
-       VHOST_FILTER(filter, file)
-       VHOST_USER
-       FILTER_TRANSPORTS
+FILTER_ROUTER(virtual_data,
+       <:VHOST_FILTER(redirect, data):>,, <:
+       VHOST_USER:>)
+FILTER_ROUTER(virtual_file,
+       <:VHOST_FILTER(filter, file):>,, <:
+       VHOST_USER:>)
 
 DIVERT(null)
 ###----- That's all, folks --------------------------------------------------