commit badadf5: [Minor] Add {header} for header regexps

Anton Yuzhaninov citrin+git at citrin.ru
Tue Dec 22 15:56:07 UTC 2020


Author: Anton Yuzhaninov
Date: 2020-12-22 13:23:48 +0000
URL: https://github.com/rspamd/rspamd/commit/badadf505179068165d4bae6c0892b5eeee1a23b

[Minor] Add {header} for header regexps

---
 rules/regexp/headers.lua | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rules/regexp/headers.lua b/rules/regexp/headers.lua
index 516fc1232..ff16fd886 100644
--- a/rules/regexp/headers.lua
+++ b/rules/regexp/headers.lua
@@ -623,7 +623,7 @@ reconf['REPTO_QUOTE_YAHOO'] = {
 }
 
 reconf['FAKE_REPLY'] = {
-  re = [[Subject=/^re:/i & !(header_exists(In-Reply-To) | header_exists(References))]],
+  re = [[Subject=/^re:/i{header} & !(header_exists(In-Reply-To) | header_exists(References))]],
   description = 'Fake reply',
   score = 1.0,
   group = 'headers'
@@ -969,7 +969,7 @@ local old_x_mailers = {
 
 reconf['OLD_X_MAILER'] = {
   description = 'X-Mailer has a very old MUA version',
-  re = string.format('X-Mailer=/^(?:%s)/', table.concat(old_x_mailers, '|')),
+  re = string.format('X-Mailer=/^(?:%s)/{header}', table.concat(old_x_mailers, '|')),
   score = 2.0,
   group = 'headers',
 }
@@ -989,7 +989,7 @@ local bad_x_mailers = {
 
 reconf['FORGED_X_MAILER'] = {
   description = 'Forged X-Mailer header',
-  re = string.format('X-Mailer=/^(?:%s)/', table.concat(bad_x_mailers, '|')),
+  re = string.format('X-Mailer=/^(?:%s)/{header}', table.concat(bad_x_mailers, '|')),
   score = 4.0,
   group = 'headers',
 }


More information about the Commits mailing list