]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Rbl: Do not check empty user/domain in rbl
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 19 Mar 2022 14:48:55 +0000 (14:48 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 19 Mar 2022 14:48:55 +0000 (14:48 +0000)
src/plugins/lua/rbl.lua

index 7d8a861eafc8d5c7c01905092d54ca8993188645..fa543e73d8e730bf7e6e02a8ab070969c56392a5 100644 (file)
@@ -662,6 +662,12 @@ local function gen_rbl_callback(rule)
     email_tbl.domain = email_tbl.domain:lower()
     email_tbl.user = email_tbl.user:lower()
 
+    if #email_tbl.domain == 0 or #email_tbl.user == 0 then
+      rspamd_logger.infox(task, "got empty/invalid email: '%s@%s'; skip it in the checks",
+          email_tbl.user, email_tbl.domain)
+      return
+    end
+
     if rule.emails_domainonly then
       add_dns_request(task, email_tbl.domain, false, false, requests_table,
           what, whitelist)
@@ -719,8 +725,8 @@ local function gen_rbl_callback(rule)
       end
 
       local email_tbl = {
-        domain = domain,
-        user = email:get_user(),
+        domain = domain or '',
+        user = email:get_user() or '',
         addr = tostring(email),
       }
       check_email_table(task, email_tbl, requests_table, whitelist, 'email')