summaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
authorAlexey <AlexeySa@users.noreply.github.com>2014-05-17 02:47:57 -0700
committerAlexey <AlexeySa@users.noreply.github.com>2014-05-17 02:47:57 -0700
commitfd6f0f795762dfb947f4737932a2ace81a9fec5b (patch)
tree593d31f69009319dca67b0b41d0ad8902277bc2a /conf
parent2adc4a9600d5a8dffa3e0f1f8c8c896e2c984ba9 (diff)
downloadrspamd-fd6f0f795762dfb947f4737932a2ace81a9fec5b.tar.gz
rspamd-fd6f0f795762dfb947f4737932a2ace81a9fec5b.zip
Hfilter: Update and fix
- Added checks for message-id host - small fixes
Diffstat (limited to 'conf')
-rw-r--r--conf/lua/hfilter.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/conf/lua/hfilter.lua b/conf/lua/hfilter.lua
index a619e8f87..cfa6e3d22 100644
--- a/conf/lua/hfilter.lua
+++ b/conf/lua/hfilter.lua
@@ -137,10 +137,12 @@ local function check_host(task, host, symbol_suffix, eq_ip, eq_host)
end
if eq_host then
eq_host = string.lower(eq_host)
+ else
+ eq_host = ''
end
if check_fqdn(host) then
- if not eq_host or (eq_host ~= 'unknown' or eq_host ~= host) then
+ if eq_host == '' or eq_host ~= 'unknown' or eq_host ~= host then
task:get_resolver():resolve_a(task:get_session(), task:get_mempool(), host, check_host_cb_a)
end
else
@@ -242,8 +244,8 @@ local function hfilter(task)
local message_id = task:get_message_id()
if message_id then
local mid_split = split(message_id, '@', 0)
- if table.maxn(mid_split) == 2 and not string.find(mid_split[2], "local") and not check_fqdn(mid_split[2]) then
- task:insert_result('HFILTER_MID_NOT_FQDN', 1.00)
+ if table.maxn(mid_split) == 2 and not string.find(mid_split[2], 'local') then
+ check_host(task, mid_split[2], 'MID', '', '')
end
end
@@ -292,6 +294,7 @@ rspamd_config:register_symbols(hfilter, 1.0,
"HFILTER_HOSTNAME_1", "HFILTER_HOSTNAME_2", "HFILTER_HOSTNAME_3", "HFILTER_HOSTNAME_4", "HFILTER_HOSTNAME_5",
"HFILTER_HELO_NORESOLVE_MX", "HFILTER_HELO_NORES_A_OR_MX", "HFILTER_HELO_IP_A", "HFILTER_HELO_NOT_FQDN",
"HFILTER_FROMHOST_NORESOLVE_MX", "HFILTER_FROMHOST_NORES_A_OR_MX", "HFILTER_FROMHOST_NOT_FQDN",
+"HFILTER_MID_NORESOLVE_MX", "HFILTER_MID_NORES_A_OR_MX", "HFILTER_MID_NOT_FQDN",
"HFILTER_MID_NOT_FQDN",
"HFILTER_HOSTNAME_UNKNOWN",
"HFILTER_URL_ONLY", "HFILTER_URL_ONELINE");