]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Rbl: Fix inversed logic of the url_full_hostname
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 19 Nov 2021 20:30:06 +0000 (20:30 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 19 Nov 2021 20:30:06 +0000 (20:30 +0000)
src/plugins/lua/rbl.lua

index 8743f125d2384ca86ed9c08a8e8cf30a6d4698bd..e901e1a2ffa365a8c2cf0d4551e683151ffafe60 100644 (file)
@@ -458,7 +458,7 @@ local function gen_rbl_callback(rule)
         mime_from_domain = ((task:get_from('mime') or E)[1] or E).domain
         if mime_from_domain then
           local mime_from_domain_tld = rule.url_full_hostname and
-              rspamd_util.get_tld(mime_from_domain) or mime_from_domain
+               mime_from_domain or rspamd_util.get_tld(mime_from_domain)
 
           if rule.url_compose_map then
             mime_from_domain = rule.url_compose_map:process_url(task, mime_from_domain_tld, mime_from_domain)
@@ -561,7 +561,7 @@ local function gen_rbl_callback(rule)
             false, requests_table, 'url', whitelist)
       else
         local url_hostname = u:get_host()
-        local url_tld = rule.url_full_hostname and u:get_tld() or url_hostname
+        local url_tld = rule.url_full_hostname and url_hostname or u:get_tld()
         if rule.url_compose_map then
           url_tld = rule.url_compose_map:process_url(task, url_tld, url_hostname)
         end