if filter == 'tld' then
local tld = util.get_tld(hostname)
return tld
+ elseif filter == 'top' then
+ local tld = util.get_tld(hostname)
+ return tld:match('[^.]*$') or tld
else
if not r['re_filter'] then
local pat = string.match(filter, 'tld:regexp:(.+)')
if filter == 'tld' then
return url:get_tld()
+ elseif filter == 'top' then
+ local tld = url:get_tld()
+ return tld:match('[^.]*$') or tld
elseif filter == 'full' then
return url:get_text()
elseif filter == 'is_phished' then
${result} = Scan Message With Rspamc ${MESSAGE} --ip 127.0.0.1 --hostname rspamd.com
Check Rspamc ${result} HOSTNAME_MAP inverse=1
+MAP - TOP
+ ${result} = Scan Message With Rspamc ${MESSAGE} --ip 127.0.0.1 --hostname example.com.au
+ Check Rspamc ${result} HOSTNAME_TOP_MAP
+
+MAP - TOP MISS
+ ${result} = Scan Message With Rspamc ${MESSAGE} --ip 127.0.0.1 --hostname example.com.bg
+ Check Rspamc ${result} HOSTNAME_TOP_MAP inverse=1
+
MAP - CDB - HOSTNAME
${result} = Scan Message With Rspamc ${MESSAGE} --ip 127.0.0.1 --hostname example.com
Check Rspamc ${result} CDB_HOSTNAME
--- /dev/null
+au
+#bg
\ No newline at end of file
type = "hostname";
map = "${TESTDIR}/configs/maps/domains.list";
}
+ HOSTNAME_TOP_MAP {
+ type = "hostname";
+ filter = "top";
+ map = "${TESTDIR}/configs/maps/top.list";
+ }
CDB_HOSTNAME {
type = "hostname";
map = "cdb://${TESTDIR}/configs/maps/domains.cdb";