From: Vsevolod Stakhov Date: Fri, 3 Feb 2017 14:10:20 +0000 (+0000) Subject: [Feature] Implement helo maps in multimap X-Git-Tag: 1.5.0~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0e76d49b5133638cee11846a1fc79d8929c865a;p=thirdparty%2Frspamd.git [Feature] Implement helo maps in multimap --- diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index b7043f466c..c36945f9d3 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'