local rspamd_redis = require "rspamd_redis"
local rspamd_url = require "rspamd_url"
local upstream_list = require "rspamd_upstream_list"
+local rspamd_util = require "rspamd_util"
--local dumper = require 'pl.pretty'.dump
local dmarc_domain
if from and from[1] and from[1]['domain'] and not from[2] then
- local url_from = rspamd_url.create(task:get_mempool(), from[1]['domain'])
- if url_from then
- dmarc_domain = url_from:get_tld()
- else
- return
- end
+ dmarc_domain = rspamd_util.get_tld(from[1]['domain'])
else
return
end
local rspamd_logger = require 'rspamd_logger'
local rspamd_ip = require 'rspamd_ip'
local rspamd_url = require 'rspamd_url'
+local rspamd_util = require 'rspamd_util'
local symbols = {
dkim_allow_symbol = 'R_DKIM_ALLOW',
end
end
task:get_resolver():resolve_a({task = task,
- name = havegot['helo'] .. '.' .. rbl['rbl'],
- callback = rbl_dns_cb,
+ name = havegot['helo'] .. '.' .. rbl['rbl'],
+ callback = rbl_dns_cb,
option = k})
end)()
end
end
for _, d in ipairs(havegot['dkim']) do
if rbl['dkim_domainonly'] then
- local url_from = rspamd_url.create(task:get_mempool(), d)
- if url_from then
- d = url_from:get_tld()
- else
- return
- end
+ d = rspamd_util.get_tld(d)
end
-
+
task:get_resolver():resolve_a({task = task,
- name = d .. '.' .. rbl['rbl'],
- callback = rbl_dns_cb,
+ name = d .. '.' .. rbl['rbl'],
+ callback = rbl_dns_cb,
option = k})
end
end)()
if validate_dns(localpart) and validate_dns(domainpart) then
table.insert(cleanList, localpart .. '.' .. domainpart)
end
- end
+ end
end
havegot['emails'] = cleanList
if not next(havegot['emails']) then
if rbl['emails'] == 'domain_only' then
for domain, _ in pairs(havegot['emails']) do
task:get_resolver():resolve_a({task = task,
- name = domain .. '.' .. rbl['rbl'],
- callback = rbl_dns_cb,
+ name = domain .. '.' .. rbl['rbl'],
+ callback = rbl_dns_cb,
option = k})
end
else
for _, email in pairs(havegot['emails']) do
task:get_resolver():resolve_a({task = task,
- name = email .. '.' .. rbl['rbl'],
- callback = rbl_dns_cb,
+ name = email .. '.' .. rbl['rbl'],
+ callback = rbl_dns_cb,
option = k})
end
end
end
task:get_resolver():resolve_a({task = task,
name = havegot['rdns'] .. '.' .. rbl['rbl'],
- callback = rbl_dns_cb,
+ callback = rbl_dns_cb,
option = k})
end)()
end
if (havegot['from']:get_version() == 6 and rbl['ipv6']) or
(havegot['from']:get_version() == 4 and rbl['ipv4']) then
task:get_resolver():resolve_a({task = task,
- name = ip_to_rbl(havegot['from'], rbl['rbl']),
- callback = rbl_dns_cb,
+ name = ip_to_rbl(havegot['from'], rbl['rbl']),
+ callback = rbl_dns_cb,
option = k})
end
end)()
not rbl['exclude_private_ips']) and ((rbl['exclude_local_ips'] and
not is_excluded_ip(rh['real_ip'])) or not rbl['exclude_local_ips']) then
task:get_resolver():resolve_a({task = task,
- name = ip_to_rbl(rh['real_ip'], rbl['rbl']),
- callback = rbl_dns_cb,
+ name = ip_to_rbl(rh['real_ip'], rbl['rbl']),
+ callback = rbl_dns_cb,
option = k})
end
end
local rspamd_logger = require "rspamd_logger"
local rspamd_url = require "rspamd_url"
+local rspamd_util = require "rspamd_util"
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(task:get_mempool(), 'http://' .. domain)
+ domain = rspamd_util.get_tld(domain)
local found = false
local mult = 1.0
- if url_domain then
- domain = url_domain:get_tld()
- end
-
if rule['map'] then
local val = rule['map']:get_key(domain)
if val then
end
end
-configure_whitelist_module()
\ No newline at end of file
+configure_whitelist_module()