From 3e031e77077b40a0334fd4c41ea1f0f25ee73158 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 10 Apr 2015 15:19:25 +0100 Subject: [PATCH] Allow satellite hosts to do alias processing. * Do smarthost relaying after alias processing, by adding a new diversion for it, rather than reusing the `routers/remote' diversion. * Move alias processing to `base.m4', and include a new diversion for additional options. * Have `satellite.m4' attach a `domains' condition to the alias processing, so that we only do this for more-or-less local addresses. --- base.m4 | 16 ++++++++++++++++ divmap.m4 | 10 ++++++---- local.m4 | 11 ----------- satellite.m4 | 7 ++++++- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/base.m4 b/base.m4 index 1c9dacf..d43a6f0 100644 --- a/base.m4 +++ b/base.m4 @@ -380,6 +380,22 @@ $1: DIVERT(null) ###-------------------------------------------------------------------------- +### Common routers. + +SECTION(routers, alias)m4_dnl +## Look up the local part in the address map. +alias: + driver = redirect + allow_fail = true + allow_defer = true + user = CONF_filter_user + FILTER_TRANSPORTS + local_parts = nwildlsearch; CONF_alias_file + data = ${expand:$local_part_data} +SECTION(routers, alias-opts)m4_dnl + +DIVERT(null) +###-------------------------------------------------------------------------- ### Some standard transports. m4_define(<:USER_DELIVERY:>, diff --git a/divmap.m4 b/divmap.m4 index 3a2d92f..7866052 100644 --- a/divmap.m4 +++ b/divmap.m4 @@ -112,10 +112,12 @@ DEFDIVERSION(routers/virtual-hooks, 410) DEFDIVERSION(routers/virtual-tail, 412) DEFDIVERSION(routers/real, 414) DEFDIVERSION(routers/alias, 416) -DEFDIVERSION(routers/allspam, 418) -DEFDIVERSION(routers/dispatch, 420) -DEFDIVERSION(routers/forward, 422) -DEFDIVERSION(routers/deliver, 424) +DEFDIVERSION(routers/alias-opts, 418) +DEFDIVERSION(routers/smarthost, 420) +DEFDIVERSION(routers/allspam, 422) +DEFDIVERSION(routers/dispatch, 424) +DEFDIVERSION(routers/forward, 426) +DEFDIVERSION(routers/deliver, 428) DEFDIVERSION(transports, 500) diff --git a/local.m4 b/local.m4 index 582e1ce..c403876 100644 --- a/local.m4 +++ b/local.m4 @@ -61,17 +61,6 @@ untrusted_set_sender = : \ ###-------------------------------------------------------------------------- ### Forwarding and redirection for incoming mail. -SECTION(routers, alias)m4_dnl -## Look up the local part in the address map. -alias: - driver = redirect - allow_fail = true - allow_defer = true - user = CONF_filter_user - FILTER_TRANSPORTS - local_parts = nwildlsearch; CONF_alias_file - data = ${expand:$local_part_data} - SECTION(routers, real)m4_dnl ## A special hack to get mail to a user who has a forward file. Only for ## special effects. diff --git a/satellite.m4 b/satellite.m4 index 088dded..6b69f20 100644 --- a/satellite.m4 +++ b/satellite.m4 @@ -26,7 +26,12 @@ SECTION(acl, connect-hooks)m4_dnl deny message = This is not a public mail server hosts = ! +allnets -SECTION(routers, remote)m4_dnl +SECTION(routers, alias-opts) + ## Only expand aliases for our home domain. + domains = +thishost +DIVERT(null) + +SECTION(routers, smarthost)m4_dnl satellite: driver = manualroute transport = smtp_local -- 2.11.0