diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-24 17:06:55 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-24 17:06:55 +0100 |
commit | 7c68de49e50574dccaf5f026a1491bf2c9df83c2 (patch) | |
tree | 9aa27693ab1cc2576a0e59aa027511732def31bc /rules/misc.lua | |
parent | 0d3cf178888070d4cd057507b8b0a9140c3dbaea (diff) | |
download | rspamd-7c68de49e50574dccaf5f026a1491bf2c9df83c2.tar.gz rspamd-7c68de49e50574dccaf5f026a1491bf2c9df83c2.zip |
[Fix] Fix R_BAD_CTE_7BIT rule
Issue: #1590
Diffstat (limited to 'rules/misc.lua')
-rw-r--r-- | rules/misc.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rules/misc.lua b/rules/misc.lua index 422edfcc3..20505828b 100644 --- a/rules/misc.lua +++ b/rules/misc.lua @@ -590,3 +590,23 @@ rspamd_config.INFO_TO_INFO_LU = { description = 'info@ From/To address with List-Unsubscribe headers', score = 2.0 } + +-- Detects bad content-transfer-encoding for text parts + +rspamd_config.R_BAD_CTE_7BIT = { + callback = function(task) + local tp = task:get_text_parts() or {} + + for _,p in ipairs(tp) do + local cte = p:get_mimepart():get_cte() or '' + if cte ~= '8bit' and p:has_8bit_raw() then + return true,1.0,cte + end + end + + return false + end, + score = 4.0, + description = 'Detects bad content-transfer-encoding for text parts', + group = 'header' +}
\ No newline at end of file |