Browse Source

[Project] Rbl: Migrate to `checks`

tags/2.7
Vsevolod Stakhov 3 years ago
parent
commit
9e9a41aedd
2 changed files with 22 additions and 39 deletions
  1. 18
    37
      conf/modules.d/rbl.conf
  2. 4
    2
      lualib/plugins/rbl.lua

+ 18
- 37
conf/modules.d/rbl.conf View 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;
}

+ 4
- 2
lualib/plugins/rbl.lua View 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)

Loading…
Cancel
Save