diff options
author | Steve Freegard <steve@stevefreegard.com> | 2017-04-11 16:13:05 +0100 |
---|---|---|
committer | Steve Freegard <steve@stevefreegard.com> | 2017-04-12 15:50:45 +0100 |
commit | 9aa169e092def662ec521adb6a07c04e46375fa0 (patch) | |
tree | 3bd6be84dd61f303503b1db3c592ab819fc20fc4 /rules/headers_checks.lua | |
parent | 8f191fa2d1318b413f764e6958e498665bc449ce (diff) | |
download | rspamd-9aa169e092def662ec521adb6a07c04e46375fa0.tar.gz rspamd-9aa169e092def662ec521adb6a07c04e46375fa0.zip |
New rules
Diffstat (limited to 'rules/headers_checks.lua')
-rw-r--r-- | rules/headers_checks.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/rules/headers_checks.lua b/rules/headers_checks.lua index 1ff27ce2f..02b177c37 100644 --- a/rules/headers_checks.lua +++ b/rules/headers_checks.lua @@ -901,3 +901,20 @@ rspamd_config.CTYPE_MISSING_DISPOSITION = { score = 4.0, group = 'header' } + +rspamd_config.CTYPE_MIXED_BOGUS = { + callback = function(task) + local ct = task:get_header('Content-Type') + if (not ct) then return false end + local parts = task:get_parts() + if (not parts) then return false end + if (ct:lower():match('^multipart/mixed') ~= nil and #parts < 3) + then + return true, tostring(#parts) + end + return false + end, + description = 'multipart/mixed with less than 3 total parts', + score = 2.0, + group = 'headers' +} |