From 08248c8fccb1e6a40d2034208a193e7535f7dc9c Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 3 May 2014 15:04:39 +0100 Subject: [PATCH] vhost.m4: Configurable spam limit in virtual hosts. --- divmap.m4 | 23 ++++++++++++----------- vhost.m4 | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/divmap.m4 b/divmap.m4 index 0e71d7f..3a2d92f 100644 --- 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) diff --git a/vhost.m4 b/vhost.m4 index 41bc715..4c13c18 100644 --- 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 -- 2.11.0