+ accept condition = ${if eq{$acl_c_mode}{submission}}
+
+ ## 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