aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf/scores.d/headers_group.conf4
-rw-r--r--src/plugins/lua/once_received.lua9
2 files changed, 13 insertions, 0 deletions
diff --git a/conf/scores.d/headers_group.conf b/conf/scores.d/headers_group.conf
index ac3134e36..55251bebf 100644
--- a/conf/scores.d/headers_group.conf
+++ b/conf/scores.d/headers_group.conf
@@ -50,6 +50,10 @@ symbols = {
weight = 1.0;
description = "Cannot resolve reverse DNS for sender's IP";
}
+ "RDNS_DNSFAIL" {
+ weight = 0.0;
+ description = "PTR verification DNS error";
+ }
"ONCE_RECEIVED_STRICT" {
weight = 4.0;
description = "One received header with 'bad' patterns inside";
diff --git a/src/plugins/lua/once_received.lua b/src/plugins/lua/once_received.lua
index 75d551ec1..503a98345 100644
--- a/src/plugins/lua/once_received.lua
+++ b/src/plugins/lua/once_received.lua
@@ -22,6 +22,7 @@ end
local symbol = 'ONCE_RECEIVED'
local symbol_rdns = 'RDNS_NONE'
+local symbol_rdns_dnsfail = 'RDNS_DNSFAIL'
local symbol_mx = 'DIRECT_TO_MX'
-- Symbol for strict checks
local symbol_strict = nil
@@ -38,6 +39,7 @@ local function check_quantity_received (task)
local function recv_dns_cb(_, to_resolve, results, err)
if err and (err ~= 'requested record is not found' and err ~= 'no records with this name') then
rspamd_logger.errx(task, 'error looking up %s: %s', to_resolve, err)
+ task:insert_result(symbol_rdns_dnsfail, 1.0)
end
task:inc_dns_req()
@@ -165,6 +167,8 @@ if opts then
symbol_strict = v
elseif n == 'symbol_rdns' then
symbol_rdns = v
+ elseif n == 'symbol_rdns_dnsfail' then
+ symbol_rdns_dnsfail = v
elseif n == 'bad_host' then
if type(v) == 'string' then
bad_hosts[1] = v
@@ -190,6 +194,11 @@ if opts then
type = 'virtual',
parent = id
})
+ rspamd_config:register_symbol({
+ name = symbol_rdns_dnsfail,
+ type = 'virtual',
+ parent = id
+ })
rspamd_config:register_symbol({
name = symbol_strict,
type = 'virtual',