Allow satellite hosts to do alias processing.
authorMark Wooding <mwooding@good.com>
Fri, 10 Apr 2015 14:19:25 +0000 (15:19 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 12 May 2015 17:24:41 +0000 (18:24 +0100)
  * 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
divmap.m4
local.m4
satellite.m4

diff --git a/base.m4 b/base.m4
index 1c9dacf..d43a6f0 100644 (file)
--- 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:>,
index 3a2d92f..7866052 100644 (file)
--- 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)
 
index 582e1ce..c403876 100644 (file)
--- 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.
index 088dded..6b69f20 100644 (file)
@@ -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