aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-16 18:05:54 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-16 18:05:54 +0100
commit87cdd1fa3ac9a7e989195ec224c9a69840ff994d (patch)
tree25de32c21256ebf71b1a6a535755f59cdcf976ba /src
parent0c8b0859135ea7bd4f1f08a15ab9a0f5c575d51f (diff)
downloadrspamd-87cdd1fa3ac9a7e989195ec224c9a69840ff994d.tar.gz
rspamd-87cdd1fa3ac9a7e989195ec224c9a69840ff994d.zip
Use tld for whitelisting.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/whitelist.lua9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/plugins/lua/whitelist.lua b/src/plugins/lua/whitelist.lua
index b7718636e..0a78a1d43 100644
--- a/src/plugins/lua/whitelist.lua
+++ b/src/plugins/lua/whitelist.lua
@@ -41,17 +41,12 @@ local function whitelist_cb(symbol, rule, task)
local from = task:get_from(1)
if from and from[1] and from[1]['domain'] then
local domain = from[1]['domain']
- local url_domain = rspamd_url.create('http://' .. domain)
+ local url_domain = rspamd_url.create(task:get_mempool(), 'http://' .. domain)
local found = false
local mult = 1.0
if url_domain then
- -- Get tld + 1 component
- local tld = url_domain:get_tld()
- local host = url_domain:get_host()
-
- domain = string.match(host, string.format('[^.].%s$', tld)
- rspamd_logger.errx(domain)
+ domain = url_domain:get_tld()
end
if rule['map'] then