aboutsummaryrefslogtreecommitdiffstats
path: root/rules/headers_checks.lua
diff options
context:
space:
mode:
authorSteve Freegard <steve@stevefreegard.com>2017-03-28 23:46:35 +0100
committerSteve Freegard <steve@stevefreegard.com>2017-03-29 15:08:00 +0100
commit785481f6d52470adcbea18858ce66f01679ce622 (patch)
treed0c6c0da807330ea23b8b68a4df00be3de2c385e /rules/headers_checks.lua
parentaae8be4c65669d6f3a5ac5825d696d5a4ac6dbad (diff)
downloadrspamd-785481f6d52470adcbea18858ce66f01679ce622.tar.gz
rspamd-785481f6d52470adcbea18858ce66f01679ce622.zip
Rules updates
Diffstat (limited to 'rules/headers_checks.lua')
-rw-r--r--rules/headers_checks.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua
index a4e202f5e..1ff27ce2f 100644
--- a/rules/headers_checks.lua
+++ b/rules/headers_checks.lua
@@ -881,3 +881,23 @@ rspamd_config:register_symbol{
type = 'virtual',
description = 'Some of the recipients match the envelope',
}
+
+rspamd_config.CTYPE_MISSING_DISPOSITION = {
+ callback = function(task)
+ local parts = task:get_parts()
+ if (not parts) or (parts and #parts < 1) then return false end
+ for _,p in ipairs(parts) do
+ local ct = p:get_header('Content-Type')
+ if (ct and ct:lower():match('^application/octet%-stream') ~= nil) then
+ local cd = p:get_header('Content-Disposition')
+ if (not cd) or (cd and cd:lower():find('^attachment') == nil) then
+ return true
+ end
+ end
+ end
+ return false
+ end,
+ description = 'Binary content-type not specified as an attachment',
+ score = 4.0,
+ group = 'header'
+}