aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-07-31 15:30:05 +0200
committerAndrew Lewis <nerf@judo.za.org>2016-07-31 15:43:15 +0200
commit17f7015829b1fa71dc51e8904bdc25bab87e1420 (patch)
treec55e0cfd60b9a09f9e29201256dd2736eab10546 /src/plugins
parent7788d8eb1d85d33e478af3cdd0249116481e69f9 (diff)
downloadrspamd-17f7015829b1fa71dc51e8904bdc25bab87e1420.tar.gz
rspamd-17f7015829b1fa71dc51e8904bdc25bab87e1420.zip
[Feature] Allow for matching hostnames in multimap (#773)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/multimap.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index 222cf3f06..56ea68214 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -486,6 +486,9 @@ local function multimap_callback(task, rule)
end
elseif rt == 'content' then
match_content(rule)
+ elseif rt == 'hostname' then
+ local hostname = task:get_hostname()
+ match_rule(rule, hostname)
end
end
@@ -559,7 +562,8 @@ local function add_multimap_rule(key, newrule)
or newrule['type'] == 'from'
or newrule['type'] == 'filename'
or newrule['type'] == 'url'
- or newrule['type'] == 'content' then
+ or newrule['type'] == 'content'
+ or newrule['type'] == 'hostname' then
if newrule['regexp'] then
newrule['hash'] = rspamd_config:add_map ({
url = newrule['map'],