phishtank_enabled = true;
# Make exclusions for known redirectors
- redirector_domains = [
- "https://maps.rspamd.com/rspamd/redirectors.inc.zst:REDIRECTOR_FALSE",
- "$LOCAL_CONFDIR/local.d/maps.d/redirectors.inc:LOCAL_REDIRECTOR_FALSE",
- "$LOCAL_CONFDIR/local.d/redirectors.inc:LOCAL_REDIRECTOR_FALSE",
- "fallback+file://${CONFDIR}/maps.d/redirectors.inc:REDIRECTOR_FALSE"
- ];
+ exceptions = {
+ REDIRECTOR_FALSE = [
+ "https://maps.rspamd.com/rspamd/redirectors.inc.zst",
+ "$LOCAL_CONFDIR/local.d/maps.d/redirectors.inc",
+ "$LOCAL_CONFDIR/local.d/redirectors.inc",
+ "fallback+file://${CONFDIR}/maps.d/redirectors.inc"
+ ];
+ PHISHED_WHITELISTED = [
+ "glob;https://maps.rspamd.com/rspamd/phishing_whitelist.inc.zst",
+ "glob;$LOCAL_CONFDIR/local.d/maps.d/phishing_whitelist.inc",
+ "glob;$LOCAL_CONFDIR/local.d/phishing_whitelist.inc",
+ ];
+ };
.include(try=true,priority=5) "${DBDIR}/dynamic/phishing.conf"
.include(try=true,priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/phishing.conf"
local generic_service_name = 'generic service'
local domains = nil
local strict_domains = {}
-local redirector_domains = {}
+local exceptions_maps = {}
+local exclude_domains = {}
local generic_service_map = nil
local openphish_map = 'https://www.openphish.com/feed.txt'
local phishtank_suffix = 'phishtank.rspamd.com'
end
end
- if not found_in_map(redirector_domains) then
+ if not found_in_map(exceptions_maps) then
if not found_in_map(strict_domains, purl, 1.0) then
if domains then
if domains:get_key(ptld) then
local function phishing_map(mapname, phishmap, id)
if opts[mapname] then
- local xd = {}
+ local xd
if type(opts[mapname]) == 'table' then
xd = opts[mapname]
else
- xd[1] = opts[mapname]
+ rspamd_logger.errx(rspamd_config, 'invalid exception table')
end
- local found_maps = {}
- for _,d in ipairs(xd) do
- local s = string.find(d, ':[^:]+$')
- if s then
- local sym = string.sub(d, s + 1, -1)
- local map = string.sub(d, 1, s - 1)
-
- if found_maps[sym] then
- table.insert(found_maps[sym], map)
- else
- found_maps[sym] = {map}
- end
- else
- rspamd_logger.infox(rspamd_config, mapname .. ' option must be in format <map>:<symbol>')
- end
- end
-
- for sym,urls in pairs(found_maps) do
+ for sym,urls in pairs(xd) do
local rmap = rspamd_config:add_map ({
type = 'set',
url = urls,
})
end
phishing_map('strict_domains', strict_domains, id)
- phishing_map('redirector_domains', redirector_domains, id)
+ phishing_map('exceptions', exceptions_maps, id)
end