From 9aa169e092def662ec521adb6a07c04e46375fa0 Mon Sep 17 00:00:00 2001 From: Steve Freegard Date: Tue, 11 Apr 2017 16:13:05 +0100 Subject: New rules --- rules/headers_checks.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'rules/headers_checks.lua') 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' +} -- cgit v1.2.3