From 0aee4274fc8853bdb6f7d666e2853f97431dbf81 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 16 Jul 2024 15:18:41 +0100 Subject: [PATCH] [Rules] Fix some old rules --- rules/regexp/headers.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/rules/regexp/headers.lua b/rules/regexp/headers.lua index ef4d532bfb..c796f0c81a 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) @@ -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' -- 2.47.3