aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-29 18:59:50 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-29 18:59:50 +0100
commit752043f91cad4b664e2eaca507f77247a110d9da (patch)
tree5f503fe4d9d9961369c17b9bf021c66c8259ef57 /src/plugins
parent3cdc26b1547af6c9b9d1e07c4248d73ceb4b5040 (diff)
downloadrspamd-752043f91cad4b664e2eaca507f77247a110d9da.tar.gz
rspamd-752043f91cad4b664e2eaca507f77247a110d9da.zip
[Minor] Allow base32 encoding for emails request
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/emails.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/lua/emails.lua b/src/plugins/lua/emails.lua
index 9199bc6f3..41b65f2ff 100644
--- a/src/plugins/lua/emails.lua
+++ b/src/plugins/lua/emails.lua
@@ -63,7 +63,13 @@ local function check_email_rule(task, rule, addr)
logger.debugm(N, task, "check %s on %s", email, rule['dnsbl'])
if rule['hash'] then
- to_resolve = hash.create_specific(rule['hash'], email):hex()
+ local hkey = hash.create_specific(rule['hash'], email)
+
+ if rule['encoding'] == 'base32' then
+ to_resolve = hkey:base32()
+ else
+ to_resolve = hkey:hex()
+ end
if rule['hashlen'] and type(rule['hashlen']) == 'number' then
if #to_resolve > rule['hashlen'] then