vhost.m4: Configurable spam limit in virtual hosts.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 3 May 2014 14:04:39 +0000 (15:04 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 3 May 2014 14:04:39 +0000 (15:04 +0100)
divmap.m4
vhost.m4

index 0e71d7f..3a2d92f 100644 (file)
--- a/divmap.m4
+++ b/divmap.m4
@@ -104,17 +104,18 @@ DEFDIVERSION(acl/misc,                     226)
 DEFDIVERSION(auth,                      300, begin authenticators)
 
 DEFDIVERSION(routers,                   400)
-DEFDIVERSION(routers/route,             402)
-DEFDIVERSION(routers/remote,            404)
-DEFDIVERSION(routers/virtual,           406)
-DEFDIVERSION(routers/virtual-hooks,     408)
-DEFDIVERSION(routers/virtual-tail,      410)
-DEFDIVERSION(routers/real,              412)
-DEFDIVERSION(routers/alias,             414)
-DEFDIVERSION(routers/allspam,           416)
-DEFDIVERSION(routers/dispatch,          418)
-DEFDIVERSION(routers/forward,           420)
-DEFDIVERSION(routers/deliver,           422)
+DEFDIVERSION(routers/virtual-spam,      402)
+DEFDIVERSION(routers/route,             404)
+DEFDIVERSION(routers/remote,            406)
+DEFDIVERSION(routers/virtual,           408)
+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(transports,                500)
 
index 41bc715..4c13c18 100644 (file)
--- a/vhost.m4
+++ b/vhost.m4
@@ -63,6 +63,20 @@ FILTER_ROUTER(virtual_file,
        <:VHOST_FILTER(file, filter):>,, <:
        VHOST_USER:>)
 
+SECTION(routers, virtual-spam)m4_dnl
+## If we're dealing with a virtual host, see if we have special spam-limit
+## rules to apply.
+SPAMLIMIT_ROUTER(virtual_spam_limit_lookup)
+       VHOST
+       condition = DOMKV(spam-limit-file, {true}{false})
+       SPAMLIMIT_LOOKUP(DOMKV(spam-limit-file),
+               , $local_part,, $domain, $sender_address)
+SPAMLIMIT_ROUTER(virtual_spam_limit_userv)
+       VHOST
+       condition = DOMKV(spam-limit-userv, {true}{false})
+       SPAMLIMIT_USERV(DOMKV(spam-limit-userv),, $local_part,,
+               $domain, $sender_address)
+
 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