From c15f9239d06e0a3f5e0165b1c9e528a422fe80d2 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 6 Apr 2017 18:07:36 +0100 Subject: [PATCH] [Feature] Allow to query hashed emails --- src/plugins/lua/emails.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/lua/emails.lua b/src/plugins/lua/emails.lua index 25e9ff88c..2c20622ca 100644 --- a/src/plugins/lua/emails.lua +++ b/src/plugins/lua/emails.lua @@ -21,6 +21,7 @@ limitations under the License. -- symbol = sym2, dnsbl = bl.somehost.com, domain_only = no local rules = {} local logger = require "rspamd_logger" +local hash = require "rspamd_cryptobox_hash" -- Check rule for a single email local function check_email_rule(task, rule, addr) @@ -41,6 +42,10 @@ local function check_email_rule(task, rule, addr) to_resolve = string.format('%s.%s.%s', addr:get_user(), addr:get_host(), rule['dnsbl']) end + if rule['hash'] then + to_resolve = hash.create_specific(rule['hash'], to_resolve):hex() + end + task:get_resolver():resolve_a({ task=task, name = to_resolve, -- 2.39.5