aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf/modules.d/rbl.conf2
-rw-r--r--doc/markdown/modules/rbl.md6
-rw-r--r--src/plugins/lua/rbl.lua16
3 files changed, 3 insertions, 21 deletions
diff --git a/conf/modules.d/rbl.conf b/conf/modules.d/rbl.conf
index 8b150371b..2d167f65a 100644
--- a/conf/modules.d/rbl.conf
+++ b/conf/modules.d/rbl.conf
@@ -4,8 +4,6 @@ rbl {
default_received = false;
default_exclude_users = true;
- private_ips = "127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 169.254.0.0/16 172.16.0.0/12 100.64.0.0/10 fc00::/7 fe80::/10 fec0::/10 ::1";
-
rbls {
spamhaus {
diff --git a/doc/markdown/modules/rbl.md b/doc/markdown/modules/rbl.md
index 3b3f624ed..24bd3532b 100644
--- a/doc/markdown/modules/rbl.md
+++ b/doc/markdown/modules/rbl.md
@@ -67,7 +67,7 @@ If set to true, do not use this RBL if the message sender is authenticated.
- default_exclude_private_ips (true)
-If true & private_ips is set appropriately, do not use the RBL if the sending host address is in the private IP list & do not check received headers baring these addresses.
+If true, do not use the RBL if the sending host address is in `local_addrs` & do not check received headers baring these addresses.
- default_exclude_local (true)
@@ -87,10 +87,6 @@ Other parameters which can be set here are:
Can be set to a URL of a list of IPv4/IPv6 addresses & subnets not to be considered as local exclusions by exclude_local checks.
-- private_ips
-
-Should be set to a space/comma/semicolon-delimited list of addresses & subnets to be considered private by exclude_private_ips checks.
-
RBL-specific subsection is structured as follows:
~~~nginx
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index 0a2b9bdd9..42bc92d3b 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -31,7 +31,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
local rbls = {}
local local_exclusions = nil
-local private_ips = nil
local rspamd_logger = require 'rspamd_logger'
local rspamd_ip = require 'rspamd_ip'
@@ -60,13 +59,6 @@ local function validate_dns(lstr)
return true
end
-local function is_private_ip(rip)
- if private_ips and private_ips:get_key(rip) then
- return true
- end
- return false
-end
-
local function is_excluded_ip(rip)
if local_exclusions and local_exclusions:get_key(rip) then
return true
@@ -145,7 +137,7 @@ local function rbl_cb (task)
end
if havegot['from'] and not notgot['from'] and ((rbl['exclude_local'] and
is_excluded_ip(havegot['from'])) or (rbl['exclude_private_ips'] and
- is_private_ip(havegot['from']))) then
+ havegot['from']:is_local())) then
return
end
end
@@ -303,7 +295,7 @@ local function rbl_cb (task)
if rh['real_ip'] and rh['real_ip']:is_valid() then
if ((rh['real_ip']:get_version() == 6 and rbl['ipv6']) or
(rh['real_ip']:get_version() == 4 and rbl['ipv4'])) and
- ((rbl['exclude_private_ips'] and not is_private_ip(rh['real_ip'])) or
+ ((rbl['exclude_private_ips'] and not rh['real_ip']:is_local()) or
not rbl['exclude_private_ips']) and ((rbl['exclude_local_ips'] and
not is_excluded_ip(rh['real_ip'])) or not rbl['exclude_local_ips']) then
task:get_resolver():resolve_a({task = task,
@@ -336,7 +328,6 @@ if type(rspamd_config.get_api_version) ~= 'nil' then
rspamd_config:register_module_option('rbl', 'default_exclude_private_ips', 'string')
rspamd_config:register_module_option('rbl', 'local_exclude_ip_map', 'string')
rspamd_config:register_module_option('rbl', 'default_exclude_local', 'string')
- rspamd_config:register_module_option('rbl', 'private_ips', 'string')
rspamd_config:register_module_option('rbl', 'default_emails', 'string')
rspamd_config:register_module_option('rbl', 'default_is_whitelist', 'string')
rspamd_config:register_module_option('rbl', 'default_ignore_whitelists', 'string')
@@ -378,9 +369,6 @@ end
if(opts['local_exclude_ip_map'] ~= nil) then
local_exclusions = rspamd_config:add_radix_map(opts['local_exclude_ip_map'])
end
-if(opts['private_ips'] ~= nil) then
- private_ips = rspamd_config:radix_from_config('rbl', 'private_ips')
-end
local white_symbols = {}
local black_symbols = {}