]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Emails module: fix hashed lookups
authorAndrew Lewis <nerf@judo.za.org>
Fri, 7 Apr 2017 10:19:18 +0000 (12:19 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 7 Apr 2017 10:19:41 +0000 (12:19 +0200)
src/plugins/lua/emails.lua

index 2c20622cab0d5af873e09f04eaafa4654732e219..1516eff39c38a6ab7bcfb3246514ecc3aec99430 100644 (file)
@@ -37,14 +37,15 @@ local function check_email_rule(task, rule, addr)
   if rule['dnsbl'] then
     local to_resolve
     if rule['domain_only'] then
-      to_resolve = string.format('%s.%s', addr:get_host(), rule['dnsbl'])
+      to_resolve = addr:get_host()
     else
-      to_resolve = string.format('%s.%s.%s', addr:get_user(), addr:get_host(), rule['dnsbl'])
+      to_resolve = string.format('%s.%s', addr:get_user(), addr:get_host())
     end
 
     if rule['hash'] then
       to_resolve = hash.create_specific(rule['hash'], to_resolve):hex()
     end
+    to_resolve = string.format('%s.%s', to_resolve, rule['dnsbl'])
 
     task:get_resolver():resolve_a({
       task=task,