summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-03 14:10:20 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-03 14:10:20 +0000
commitc0e76d49b5133638cee11846a1fc79d8929c865a (patch)
tree5cafe6aa421920365ba37dc04c155d569d1ff5ee
parent1d2a2bc086198a2940652b35259c1603e4511fc0 (diff)
downloadrspamd-c0e76d49b5133638cee11846a1fc79d8929c865a.tar.gz
rspamd-c0e76d49b5133638cee11846a1fc79d8929c865a.zip
[Feature] Implement helo maps in multimap
-rw-r--r--src/plugins/lua/multimap.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index b7043f466..c36945f9d 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -35,6 +35,9 @@ local value_types = {
from = {
get_value = function(val) return val end,
},
+ helo = {
+ get_value = function(val) return val end,
+ },
header = {
get_value = function(val) return val end,
},
@@ -327,6 +330,7 @@ end
local multimap_filters = {
from = apply_addr_filter,
to = apply_addr_filter,
+ helo = apply_hostname_filter,
header = apply_addr_filter,
url = apply_url_filter,
filename = apply_filename_filter,
@@ -593,6 +597,11 @@ local function multimap_callback(task, rule)
local from = task:get_from('smtp')
match_addr(rule, from)
end
+ elseif rt == 'helo' then
+ local helo = task:get_helo()
+ if helo then
+ match_hostname(rule, helo)
+ end
elseif rt == 'url' then
if task:has_urls() then
local msg_urls = task:get_urls()
@@ -732,6 +741,7 @@ local function add_multimap_rule(key, newrule)
elseif newrule['type'] == 'header'
or newrule['type'] == 'rcpt'
or newrule['type'] == 'from'
+ or newrule['type'] == 'helo'
or newrule['type'] == 'filename'
or newrule['type'] == 'url'
or newrule['type'] == 'content'