aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-07-16 15:18:41 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-07-16 15:18:41 +0100
commit0aee4274fc8853bdb6f7d666e2853f97431dbf81 (patch)
tree146619790f02d213b2bd7d06634e1f2fe7a7bc26 /rules
parent5e2ef60f9bed99b00bc96c87ce94eab104239937 (diff)
downloadrspamd-0aee4274fc8853bdb6f7d666e2853f97431dbf81.tar.gz
rspamd-0aee4274fc8853bdb6f7d666e2853f97431dbf81.zip
[Rules] Fix some old rules
Diffstat (limited to 'rules')
-rw-r--r--rules/regexp/headers.lua17
1 files changed, 10 insertions, 7 deletions
diff --git a/rules/regexp/headers.lua b/rules/regexp/headers.lua
index ef4d532bf..c796f0c81 100644
--- a/rules/regexp/headers.lua
+++ b/rules/regexp/headers.lua
@@ -31,6 +31,9 @@ reconf['SUBJECT_NEEDS_ENCODING'] = {
score = 1.0,
mime_only = true,
description = 'Subject needs encoding',
+ condition = function()
+ return not rspamd_config:is_mime_utf()
+ end,
group = 'headers'
}
@@ -42,6 +45,9 @@ reconf['FROM_NEEDS_ENCODING'] = {
score = 1.0,
mime_only = true,
description = 'From header needs encoding',
+ condition = function()
+ return not rspamd_config:is_mime_utf()
+ end,
group = 'headers'
}
@@ -53,7 +59,10 @@ reconf['TO_NEEDS_ENCODING'] = {
score = 1.0,
mime_only = true,
description = 'To header needs encoding',
- group = 'headers'
+ condition = function()
+ return not rspamd_config:is_mime_utf()
+ end,
+ group = 'headers',
}
-- Detects that there is no space in From header (e.g. Some Name<some@host>)
@@ -713,12 +722,6 @@ reconf['HEADER_DATE_EMPTY_DELIMITER'] = {
}
-- Definitions of received headers regexp
-reconf['RCVD_ILLEGAL_CHARS'] = {
- re = 'Received=/[\\x80-\\xff]/X',
- score = 4.0,
- description = 'Received header has raw illegal character',
- group = 'headers'
-}
local MAIL_RU_Return_Path = 'Return-path=/^\\s*<.+\\@mail\\.ru>$/iX'
local MAIL_RU_X_Envelope_From = 'X-Envelope-From=/^\\s*<.+\\@mail\\.ru>$/iX'