summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Freegard <steve@stevefreegard.com>2018-03-19 11:53:38 +0000
committerSteve Freegard <steve@stevefreegard.com>2018-03-19 11:53:38 +0000
commit8102f9c77e04fdbf63619f8e9d90c263078d5bcc (patch)
treedf79669d944a7f1f1418e93501519c3c2450f191
parenta91100df14b0421960e482d2df6b167d978f4d6e (diff)
downloadrspamd-8102f9c77e04fdbf63619f8e9d90c263078d5bcc.tar.gz
rspamd-8102f9c77e04fdbf63619f8e9d90c263078d5bcc.zip
Split MISSING_SUBJECT into EMPTY_SUBJECT based on corpus testing
-rw-r--r--rules/regexp/headers.lua16
1 files changed, 11 insertions, 5 deletions
diff --git a/rules/regexp/headers.lua b/rules/regexp/headers.lua
index e80380197..2570e9f75 100644
--- a/rules/regexp/headers.lua
+++ b/rules/regexp/headers.lua
@@ -62,17 +62,23 @@ reconf['R_NO_SPACE_IN_FROM'] = {
group = 'header'
}
-rspamd_config.MISSING_SUBJECT = {
+-- Detects missing Subject header
+reconf['MISSING_SUBJECT'] = {
+ re = '!raw_header_exists(Subject)',
score = 2.0,
- description = 'Subject is missing inside message',
+ description = 'Subject header is missing',
+ group = 'header'
+}
+
+rspamd_config.EMPTY_SUBJECT = {
+ score = 1.0,
+ description = 'Subject header is empty',
group = 'header',
callback = function(task)
local hdr = task:get_header('Subject')
-
- if not hdr or #hdr == 0 then
+ if hdr and #hdr == 0 then
return true
end
-
return false
end
}