From 652f423ee3cedfe6a331c29def14461c0ca2c059 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 29 Jun 2017 08:47:52 +0100 Subject: [PATCH] [Minor] Allow to cut hashes when checking emails --- src/plugins/lua/emails.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/lua/emails.lua b/src/plugins/lua/emails.lua index bda3d4f77..e27a783ef 100644 --- a/src/plugins/lua/emails.lua +++ b/src/plugins/lua/emails.lua @@ -62,6 +62,12 @@ local function check_email_rule(task, rule, addr) if rule['hash'] then to_resolve = hash.create_specific(rule['hash'], email):hex() + + if rule['hashlen'] and type(rule['hashlen']) == 'number' then + if #to_resolve > rule['hashlen'] then + to_resolve = string.sub(to_resolve, 1, rule['hashlen']) + end + end else to_resolve = email end -- 2.39.5