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
})
else
logger.infox('DCC module not configured');
-end
\ No newline at end of file
+end
-- 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'
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,
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
end,
hostname = function()
local hostname = task:get_hostname()
- if hostname and hostname ~= 'unknown' then
+ if hostname then
match_hostname(rule, hostname)
end
end,
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,