]> source.dussan.org Git - rspamd.git/commitdiff
Split MISSING_SUBJECT into EMPTY_SUBJECT based on corpus testing
authorSteve Freegard <steve@stevefreegard.com>
Mon, 19 Mar 2018 11:53:38 +0000 (11:53 +0000)
committerSteve Freegard <steve@stevefreegard.com>
Mon, 19 Mar 2018 11:53:38 +0000 (11:53 +0000)
rules/regexp/headers.lua

index e803801974ff11c62b141ff4bdf2b3fbbbfb3f83..2570e9f75ae60112d57eaeb88fca1e1a4610589c 100644 (file)
@@ -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
 }