]> source.dussan.org Git - rspamd.git/commitdiff
DNSWL support (via RBL) added
authoreneq123 <you@example.com>
Wed, 7 May 2014 11:43:43 +0000 (15:43 +0400)
committereneq123 <you@example.com>
Wed, 7 May 2014 11:43:43 +0000 (15:43 +0400)
conf/metrics.conf
conf/modules.conf
src/plugins/lua/rbl.lua

index 088d6aaca5a3765822ccf29653cf9b218ef5ab49..520f05a7484294dee72eb61f3ac00dc5e05f6477 100644 (file)
@@ -322,6 +322,12 @@ metric {
         description = "One received header with 'bad' patterns inside";
         name = "ONCE_RECEIVED_STRICT";
     }
+
+    symbol { name = "RCVD_IN_DNSWL"; weight = 0.0; description = "Sender listed at http://www.dnswl.org"; }
+    symbol { name = "RCVD_IN_DNSWL_LOW"; weight = -0.1; description = "Sender listed at http://www.dnswl.org, low trust"; }
+    symbol { name = "RCVD_IN_DNSWL_MED"; weight = -1.0; description = "Sender listed at http://www.dnswl.org, medium trust"; }
+    symbol { name = "RCVD_IN_DNSWL_HI"; weight = -5.0; description = "Sender listed at http://www.dnswl.org, high trust"; }
+
     symbol { name = "RBL_SPAMHAUS"; weight = 0.0; description = "From address is listed in zen"; }
     symbol { name = "RBL_SPAMHAUS_SBL"; weight = 2.0; description = "From address is listed in zen sbl"; }
     symbol { name = "RBL_SPAMHAUS_CSS"; weight = 2.0; description = "From address is listed in zen css"; }
index 4ad8fc88c3bebadb8c70c3bb331d25655c857183..0640def55689409604fe8061bed5c880337d093c 100644 (file)
@@ -83,8 +83,7 @@ surbl {
     }
 }
 rbl {
-
-    rbls {
+ rbls {
        
        spamhaus {
                symbol = "RBL_SPAMHAUS";
@@ -145,6 +144,21 @@ rbl {
             RBL_SEM = "127.0.0.2";
         }
     }
+
+    dnswl {
+        symbol = "RCVD_IN_DNSWL";
+        rbl = "list.dnswl.org";
+        ipv4 = true;
+        ipv6 = false;
+        received = false;
+        unknown = true;
+        returncodes {
+            RCVD_IN_DNSWL_LOW = "127.0.*.1";
+            RCVD_IN_DNSWL_MED = "127.0.*.2";
+            RCVD_IN_DNSWL_HI  = "127.0.*.3";
+        }
+    }
+
  }
 }
 
index bf043e19e5203cfc40d638afd249b67d34814ad2..da52c0fba4046e36b73a402506f90f02a2ca4ca5 100644 (file)
@@ -25,14 +25,14 @@ local function rbl_cb (task)
                                                local foundrc = false
                                                for s,i in pairs(thisrbl['returncodes']) do
                                                        if type(i) == 'string' then
-                                                               if i == ipstr then
+                                                               if (string.find(ipstr, i)) then
                                                                        foundrc = true
                                                                        task:insert_result(s, 1)
                                                                        break
                                                                end
                                                        elseif type(i) == 'table' then
                                                                for _,v in pairs(i) do
-                                                                       if v == ipstr then
+                                                                       if (string.find(ipstr, v)) then
                                                                                foundrc = true
                                                                                task:insert_result(s, 1)
                                                                                break