From 3e96b3aeaab8463933d471111ba3531be166652b Mon Sep 17 00:00:00 2001 Message-Id: <3e96b3aeaab8463933d471111ba3531be166652b.1716656777.git.mdw@distorted.org.uk> From: Mark Wooding Date: Wed, 23 Mar 2016 22:22:23 +0000 Subject: [PATCH] spam.m4: Hoist the spam-report formatting to before the rejection. Organization: Straylight/Edgeware From: Mark Wooding We're going to want this report either way. --- spam.m4 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/spam.m4 b/spam.m4 index 14596b4..897e6a9 100644 --- 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):>) -- [mdw]