chiark / gitweb /
spam.m4: Hoist the spam-report formatting to before the rejection.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 23 Mar 2016 22:22:23 +0000 (22:22 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 23 Mar 2016 22:22:23 +0000 (22:22 +0000)
We're going to want this report either way.

spam.m4

diff --git a/spam.m4 b/spam.m4
index 14596b4bb597e01ac56a14edd4aae97f41caf761..897e6a9501b832a9b9a2a9133f5eb8fea1e96eb4 100644 (file)
--- a/spam.m4
+++ b/spam.m4
@@ -151,13 +151,9 @@ data_spam:
        require  verify = header_syntax
 
        ## Check the message for spam, comparing to the configured limit.
-       deny     spam = exim:true
-                message = Tinned meat product detected ($spam_score)
-                condition = ${if >{$spam_score_int}{$acl_m_spam_limit} \
-                                 {true}{false}}
+       warn     spam = exim:true
 
-       ## Insert headers from the spam check now that we've decided to
-       ## accept the message.
+       ## Format some reporting stuff.
        warn
 
                 ## Convert the limit (currently 10x fixed point) into a
@@ -204,7 +200,14 @@ data_spam:
                 ## Undo the escaping.
                 set acl_m_spam_tests = ${sg{$acl_m_spam_tests}{!(.)}{\$1}}
 
-                ## Insert the headers.
+       ## If we've decided to reject, then tell the sender to get knotted.
+       deny     message = Tinned meat product detected ($spam_score)
+                condition = ${if >{$spam_score_int}{$acl_m_spam_limit} \
+                                 {true}{false}}
+
+       ## Insert headers from the spam check now that we've decided to
+       ## accept the message.
+       warn
                 ADD_HEADER(<:X-CONF_header_token-SpamAssassin-Score: \
                        $spam_score/$acl_m_spam_limit_presentation \
                        ($spam_bar):>)