Browse Source

[Minor] Stop expecting hostname to be "unknown"

tags/1.7.0
Andrew Lewis 6 years ago
parent
commit
286ed38486

+ 2
- 2
src/plugins/lua/dcc.lua View File

@@ -45,7 +45,7 @@ local function check_dcc (task)
client = client_ip:to_string()
end
local client_host = task:get_hostname()
if client_host and client_host ~= 'unknown' then
if client_host then
client = client .. "\r" .. client_host
end

@@ -140,4 +140,4 @@ if opts and opts['host'] then
})
else
logger.infox('DCC module not configured');
end
end

+ 1
- 1
src/plugins/lua/greylist.lua View File

@@ -284,7 +284,7 @@ local function greylist_set(task)
-- Third and second level domains whitelist
if not is_whitelisted and whitelist_domains_map then
local hostname = task:get_hostname()
if hostname and hostname ~= 'unknown' then
if hostname then
local domain = rspamd_util.get_tld(hostname)
if whitelist_domains_map:get_key(hostname) or (domain and whitelist_domains_map:get_key(domain)) then
is_whitelisted = 'meta'

+ 8
- 10
src/plugins/lua/hfilter.lua View File

@@ -307,7 +307,7 @@ local function check_host(task, host, symbol_suffix, eq_ip, eq_host)
end

if check_fqdn(host) then
if eq_host == '' or eq_host ~= 'unknown' or eq_host ~= host then
if eq_host == '' or eq_host ~= host then
task:get_resolver():resolve('a', {
task=task,
name = host,
@@ -462,17 +462,15 @@ local function hfilter(task)
if config['hostname_enabled'] then
if hostname then
-- Check regexp HOSTNAME
if hostname == 'unknown' then
task:insert_result('HFILTER_HOSTNAME_UNKNOWN', 1.00)
else
local weights = checks_hellohost_map:get_key(hostname)
for _,weight in ipairs(weights or {}) do
weight = tonumber(weight) or 0
if weight > weight_hostname then
weight_hostname = weight
end
local weights = checks_hellohost_map:get_key(hostname)
for _,weight in ipairs(weights or {}) do
weight = tonumber(weight) or 0
if weight > weight_hostname then
weight_hostname = weight
end
end
else
task:insert_result('HFILTER_HOSTNAME_UNKNOWN', 1.00)
end
end


+ 1
- 1
src/plugins/lua/multimap.lua View File

@@ -756,7 +756,7 @@ local function multimap_callback(task, rule)
end,
hostname = function()
local hostname = task:get_hostname()
if hostname and hostname ~= 'unknown' then
if hostname then
match_hostname(rule, hostname)
end
end,

+ 1
- 1
src/plugins/lua/once_received.lua View File

@@ -90,7 +90,7 @@ local function check_quantity_received (task)

local hn = task:get_hostname()
-- Here we don't care about received
if (not hn or hn == 'unknown') and task_ip and task_ip:is_valid() then
if (not hn) and task_ip and task_ip:is_valid() then
task:get_resolver():resolve_ptr({task = task,
name = task_ip:to_string(),
callback = recv_dns_cb,

Loading…
Cancel
Save