aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-23 14:58:47 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-23 14:59:11 +0100
commita3c702c144cc967f627f28d1f6e75c415008975c (patch)
treedca7a8d987ba83f154e75fd7f0d484f4801c5594 /src/plugins
parent8c12705705f5f3569c62c3d82b504eae66a0860a (diff)
downloadrspamd-a3c702c144cc967f627f28d1f6e75c415008975c.tar.gz
rspamd-a3c702c144cc967f627f28d1f6e75c415008975c.zip
[Conf] Enable phishtank DNS lookups by default, fix module
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/phishing.lua25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua
index 254922d73..deca221cd 100644
--- a/src/plugins/lua/phishing.lua
+++ b/src/plugins/lua/phishing.lua
@@ -39,7 +39,8 @@ local openphish_map = 'https://www.openphish.com/feed.txt'
local phishtank_suffix = 'phishtank.rspamd.com'
-- Not enabled by default as their feed is quite large
local openphish_premium = false
-local phishtank_enabled = false
+-- Published via DNS
+local phishtank_enabled = true
local generic_service_hash
local openphish_hash
local generic_service_data = {}
@@ -143,12 +144,20 @@ local function phishing_cb(task)
if host and path then
local function host_host_path_cb(_, _, results, err)
if not err and results then
- task:insert_result(phish_symbol, 0.3, results)
+ if not query then
+ task:insert_result(phish_symbol, 0.3, results)
+ else
+ task:insert_result(phish_symbol, 1.0, results)
+ end
end
end
- r:resolve_a({
+
+ local to_resolve_hp = compose_dns_query({host, path})
+ rspamd_logger.debugm(N, task, 'try to resolve {%s, %s} -> %s',
+ host, path, to_resolve_hp)
+ r:resolve_txt({
task = task,
- name = compose_dns_query({host, path}),
+ name = to_resolve_hp,
callback = host_host_path_cb})
@@ -158,9 +167,13 @@ local function phishing_cb(task)
task:insert_result(phish_symbol, 1.0, results)
end
end
- r:resolve_a({
+
+ local to_resolve_hpq = compose_dns_query({host, path, query})
+ rspamd_logger.debugm(N, task, 'try to resolve {%s, %s, %s} -> %s',
+ host, path, query, to_resolve_hpq)
+ r:resolve_txt({
task = task,
- name = compose_dns_query({host, path, query}),
+ name = to_resolve_hpq,
callback = host_host_path_query_cb})
end