From: Vsevolod Stakhov Date: Thu, 6 Apr 2017 17:07:36 +0000 (+0100) Subject: [Feature] Allow to query hashed emails X-Git-Tag: 1.5.5~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c15f9239d06e0a3f5e0165b1c9e528a422fe80d2;p=thirdparty%2Frspamd.git [Feature] Allow to query hashed emails --- diff --git a/src/plugins/lua/emails.lua b/src/plugins/lua/emails.lua index 25e9ff88c3..2c20622cab 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,