From 87afdfcd0186f0f455034c92257b46a015174335 Mon Sep 17 00:00:00 2001 Message-Id: <87afdfcd0186f0f455034c92257b46a015174335.1714919994.git.mdw@distorted.org.uk> From: Mark Wooding Date: Wed, 14 May 2014 09:54:56 +0100 Subject: [PATCH] spam.m4: No, we can't check domains in the DATA ACL. Organization: Straylight/Edgeware From: Mark Wooding Whoops. We've been deferring for a while. This is quite bad. --- spam.m4 | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/spam.m4 b/spam.m4 index 4253e88..9b7fe0d 100644 --- a/spam.m4 +++ b/spam.m4 @@ -103,18 +103,26 @@ 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}) + ## If all domains have disabled spam checking then don't check. + accept !condition = $acl_c_spam_check_domain ## Otherwise we should check. deny rcpt_spam: + ## If this is a virtual domain, and it says `spam-check=no', then we + ## shouldn't check spam. But we can't check domains at DATA time, so + ## instead we must track whether all recipients have disabled + ## checking. + warn !domains = ${if exists{CONF_sysconf_dir/domains.conf} \ + {partial0-lsearch; CONF_sysconf_dir/domains.conf} \ + {}} + set acl_c_spam_check_domain = true + warn !condition = $acl_c_spam_check_domain + condition = DOMKV(spam-check, {${expand:$value}}{true}) + set acl_c_spam_check_domain = true + ## See if we should do this check. accept acl = skip_spam_check -- [mdw]