]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Add Yandex and Mail.ru forwarding rules
authorAlexey AL <AlexeySa@users.noreply.github.com>
Sun, 21 Aug 2016 11:44:02 +0000 (14:44 +0300)
committerGitHub <noreply@github.com>
Sun, 21 Aug 2016 11:44:02 +0000 (14:44 +0300)
rules/forwarding.lua

index 65c5e3100f30e02230ee925e26f1d41957f61a77..df9a97b802f74af01f681ec3e996ce33418fae4d 100644 (file)
@@ -45,6 +45,42 @@ rspamd_config.FWD_GOOGLE = {
     group = "forwarding"
 }
 
+rspamd_config.FWD_YANDEX = {
+    callback = function (task)
+        if not (task:has_from(1) and task:has_recipients(1)) then
+            return false
+        end
+        local hostname = task:get_hostname()
+        if hostname and hostname:lower():find('%.yandex%.[a-z]+$') then
+            if task:get_header_raw('X-Yandex-Forward') then
+                return true
+            end
+        end
+        return false
+    end,
+    score = 0.0,
+    description = "Message was forwarded by Yandex",
+    group = "forwarding"
+}
+
+rspamd_config.FWD_MAILRU = {
+    callback = function (task)
+        if not (task:has_from(1) and task:has_recipients(1)) then
+            return false
+        end
+        local hostname = task:get_hostname()
+        if hostname and hostname:lower():find('%.mail%.ru$') then
+            if task:get_header_raw('X-MailRu-Forward') then
+                return true
+            end
+        end
+        return false
+    end,
+    score = 0.0,
+    description = "Message was forwarded by Mail.ru",
+    group = "forwarding1"
+}
+
 rspamd_config.FWD_SRS = {
     callback = function (task)
         if not (task:has_from(1) and task:has_recipients(1)) then