exim: Restructure the spam handling acls.
[matthijs/servers/drsnuggles.git] / etc / exim4 / conf.d / acl / 40_exim4-config_check_data
index b9765c565d47ec2cdd178984c911eec97be32bb1..58a65f3f148caf65d85eab9e918419cc3a9a65e4 100644 (file)
@@ -22,7 +22,21 @@ acl_check_data:
     message = No verifiable sender address in message headers
     !verify = header_sender
 
-  # accept otherwise
+  # Don't spamcheck big messages
   accept
+    condition = ${if >{$message_size}{80k}}
+    add_header = X-Spam-Report: Message too big, not scanned.
+
+  # Deny messages with a large spamscore. The threshold is set by
+  # spamassassin, see required_score in /etc/spamassassin/local.cf
+  deny
+    message = Message was classified as spam
+    # Check using spamassasin, running as the "spamd" user.
+    spam = spamd
+
+  # Accept any other messages, but add spam headers.
+  accept
+    add_header = X-Spam-Score: $spam_score ($spam_bar)
+    add_header = X-Spam-Report: $spam_report
 
 # vim: set sts=2 expandtab sw=2 ai: