]> source.dussan.org Git - rspamd.git/commitdiff
Add INFO_TO_INFO_LU rule 1602/head
authorSteve Freegard <steve@stevefreegard.com>
Wed, 19 Apr 2017 15:01:56 +0000 (16:01 +0100)
committerSteve Freegard <steve@stevefreegard.com>
Wed, 19 Apr 2017 15:01:56 +0000 (16:01 +0100)
rules/misc.lua

index 6eab5c85a15eb645059fd019914a4f504048a372..422edfcc31dc5cb6659adcdc5bdc28a718e4f94a 100644 (file)
@@ -568,3 +568,25 @@ rspamd_config.SPOOF_REPLYTO = {
   description = 'Reply-To is being used to spoof and trick the recipient to send an off-domain reply',
   score = 6.0
 }
+
+rspamd_config.INFO_TO_INFO_LU = {
+  callback = function(task)
+    local lu = task:get_header('List-Unsubscribe')
+    if not lu then return false end
+    local from = task:get_from('mime')
+    if not (from and from[1] and util.strequal_caseless(from[1].user, 'info')) then
+      return false
+    end
+    local to = task:get_recipients('smtp')
+    local found = false
+    for _,r in ipairs(to) do
+      if util.strequal_caseless(r['user'], 'info') then
+        found = true
+      end
+    end
+    if found then return true end
+    return false
+  end,
+  description = 'info@ From/To address with List-Unsubscribe headers',
+  score = 2.0
+}