spam.m4: Allow virtual domains to opt out of spam checking.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 12 May 2014 19:04:00 +0000 (20:04 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 12 May 2014 19:04:00 +0000 (20:04 +0100)
spam.m4

diff --git a/spam.m4 b/spam.m4
index ce9c8e3..4253e88 100644 (file)
--- a/spam.m4
+++ b/spam.m4
@@ -103,6 +103,13 @@ skip_spam_check:
        accept   hosts = +trusted
        accept   condition = ${if eq{$acl_c_mode}{submission}}
 
+       ## If this is a virtual domain, and it says `spam-check=no', then
+       ## skip.
+       accept   domains = ${if exists{CONF_sysconf_dir/domains.conf} \
+                        {partial0-lsearch; CONF_sysconf_dir/domains.conf} \
+                        {}}
+               !condition = DOMKV(spam-check, {${expand:$value}}{true})
+
        ## Otherwise we should check.
        deny