msg_err_config ("load of %s failed: %s", module->path,
lua_tostring (L, -1));
cur = g_list_next (cur);
- g_string_free (tb, TRUE);
lua_pop (L, 1); /* Error function */
continue;
}
]]--
local rspamd_logger = require "rspamd_logger"
+local rspamd_url = require "rspamd_url"
local ucl = require "ucl"
require "fun" ()
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 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)
+ end
+
if rule['map'] then
local val = rule['map']:get_key(domain)
if val then