From 7ab75d6f000cb2f27c85f9f38b597535efc5fa0b Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 5 Mar 2014 17:36:22 +0000 Subject: [PATCH] Change how filtering routers work. 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 | 12 ++++++++++-- local.m4 | 21 +++++++-------------- vhost.m4 | 21 ++++++--------------- 3 files changed, 23 insertions(+), 31 deletions(-) diff --git a/base.m4 b/base.m4 index 0827835..f8b2901 100644 --- 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. diff --git a/local.m4 b/local.m4 index 7abf456..52398aa 100644 --- 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. diff --git a/vhost.m4 b/vhost.m4 index 603b238..6a710cb 100644 --- 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 -------------------------------------------------- -- 2.11.0