]> source.dussan.org Git - rspamd.git/commitdiff
[Project] Rbl: Migrate to `checks`
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Oct 2020 14:10:02 +0000 (15:10 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Oct 2020 14:10:02 +0000 (15:10 +0100)
conf/modules.d/rbl.conf
lualib/plugins/rbl.lua

index 6a0b37ce05b00133ada76cfe36415f3b0a2e181d..1a97efc06f26b3cba6e59ef55afe8675a0b160b4 100644 (file)
@@ -34,8 +34,7 @@ rbl {
       symbol = "SPAMHAUS"; # Augmented by prefixes
       rbl = "zen.spamhaus.org";
       # Check types
-      received = true;
-      from = true;
+      checks = ['received', 'from'];
 
       symbols_prefixes = {
         received = 'RECEIVED',
@@ -57,7 +56,7 @@ rbl {
       symbol = "MAILSPIKE";
       rbl = "rep.mailspike.net";
       is_whitelist = true;
-      from = true; # Check source IP address
+      checks = ['from'];
       whitelist_exception = "MAILSPIKE";
       whitelist_exception = "RWL_MAILSPIKE_GOOD";
       whitelist_exception = "RWL_MAILSPIKE_NEUTRAL";
@@ -79,7 +78,7 @@ rbl {
 
     senderscore {
       symbol = "RBL_SENDERSCORE";
-      from = true; # Check source IP address
+      checks = ['from'];
       rbl = "bl.score.senderscore.com";
     }
 
@@ -87,7 +86,7 @@ rbl {
       symbol = "RBL_SEM";
       rbl = "bl.spameatingmonkey.net";
       ipv6 = false;
-      from = true; # Check source IP address
+      checks = ['from'];
     }
 
     semIPv6 {
@@ -95,15 +94,14 @@ rbl {
       rbl = "bl.ipv6.spameatingmonkey.net";
       ipv4 = false;
       ipv6 = true;
-      from = true; # Check source IP address
+      checks = ['from'];
     }
 
     dnswl {
       symbol = "RCVD_IN_DNSWL";
       rbl = "list.dnswl.org";
       ipv6 = true;
-      from = true; # Check source IP address
-      received = true; # Check source IP address
+      checks = ['from', 'received'];
       is_whitelist = true;
       whitelist_exception = "RCVD_IN_DNSWL";
       whitelist_exception = "RCVD_IN_DNSWL_NONE";
@@ -123,7 +121,7 @@ rbl {
       symbol = "RBL_VIRUSFREE_UNKNOWN";
       rbl = "bip.virusfree.cz";
       ipv6 = true;
-      from = true; # Check source IP address
+      checks = ['from'];
       returncodes {
         RBL_VIRUSFREE_BOTNET = "127.0.0.2";
       }
@@ -133,7 +131,7 @@ rbl {
       symbol = "RBL_NIXSPAM";
       rbl = "ix.dnsbl.manitu.net";
       ipv6 = true;
-      from = true; # Check source IP address
+      checks = ['from'];
     }
 
     blocklistde {
@@ -144,17 +142,14 @@ rbl {
       symbol = "BLOCKLISTDE";
       rbl = "bl.blocklist.de";
       ipv6 = true;
-      received = true;
-      from = true;
+      checks = ['from', 'received'];
     }
 
     # Dkim whitelist
     dnswl_dwl {
       symbol = "DWL_DNSWL";
       rbl = "dwl.dnswl.org";
-      dkim = true;
-      dkim_domainonly = false;
-      dkim_match_from = true;
+      checks = ['dkim'];
       ignore_whitelist = true;
       unknown = false;
 
@@ -174,8 +169,7 @@ rbl {
       hash_format = "base32";
       hash_len = 32;
       rbl = "email.rspamd.com";
-      emails = true; # Emails in body
-      replyto = true; # Email from reply-to header
+      checks = ['emails', 'replyto'];
       hash = "blake2";
       returncodes = {
         RSPAMD_EMAILBL = "127.0.0.2";
@@ -185,8 +179,7 @@ rbl {
       ignore_whitelist = true;
       ignore_defaults = true;
       rbl = "ebl.msbl.org";
-      emails = true; # Emails in body
-      replyto = true; # Email from reply-to header
+      checks = ['emails', 'replyto'];
       emails_domainonly = false;
       hash = "sha1";
       returncodes = {
@@ -204,9 +197,7 @@ rbl {
     "SURBL_MULTI" {
       ignore_defaults = true;
       rbl = "multi.surbl.org";
-      dkim = true;
-      emails = true;
-      urls = true;
+      checks = ['emails', 'dkim', 'urls'];
       emails_domainonly = true;
 
       returnbits = {
@@ -221,9 +212,7 @@ rbl {
     "URIBL_MULTI" {
       ignore_defaults = true;
       rbl = "multi.uribl.com";
-      dkim = true;
-      emails = true;
-      urls = true;
+      checks = ['emails', 'dkim', 'urls'];
       emails_domainonly = true;
 
       returnbits {
@@ -237,9 +226,7 @@ rbl {
     "RSPAMD_URIBL" {
       ignore_defaults = true;
       rbl = "uribl.rspamd.com";
-      dkim = true;
-      emails = true;
-      urls = true;
+      checks = ['emails', 'dkim', 'urls'];
       emails_domainonly = true;
       hash = 'blake2';
       hash_len = 32;
@@ -256,10 +243,8 @@ rbl {
       ignore_defaults = true;
       rbl = "dbl.spamhaus.org";
       no_ip = true;
-      dkim = true;
-      emails = true;
+      checks = ['emails', 'dkim', 'urls'];
       emails_domainonly = true;
-      urls = true;
 
       returncodes = {
         # spam domain
@@ -306,10 +291,8 @@ rbl {
       ignore_defaults = true;
       rbl = "uribl.spameatingmonkey.net";
       no_ip = true;
-      dkim = true;
-      emails = true;
+      checks = ['emails', 'dkim', 'urls'];
       emails_domainonly = true;
-      urls = true;
       returnbits {
         SEM_URIBL = 2;
       }
@@ -319,10 +302,8 @@ rbl {
       ignore_defaults = true;
       rbl = "fresh15.spameatingmonkey.net";
       no_ip = true;
-      dkim = true;
-      emails = true;
+      checks = ['emails', 'dkim', 'urls'];
       emails_domainonly = true;
-      urls = true;
       returnbits {
         SEM_URIBL_FRESH15 = 2;
       }
index 7105d73a4b4c076ac12852fe30b4d38165ff41fa..4eeff7b09d533c50dd50f184e39a6c8e08411fc6 100644 (file)
@@ -142,13 +142,15 @@ local function convert_checks(rule)
           rspamd_logger.errx(rspamd_config, 'rbl rule %s has check %s which requires an argument',
               rule.symbol, check)
           return nil
-        else
-          rule[check] = check_type
         end
       end
+
+      rule[check] = check_type
+
       if not check_type.connfilter then
         all_connfilter = false
       end
+
       if not check_type then
         rspamd_logger.errx(rspamd_config, 'rbl rule %s has invalid check type: %s',
             rule.symbol, check)