summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-26 18:40:07 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-26 18:40:07 +0300
commitf94a016916b5f2b08d15c46d2cada9149507f16b (patch)
tree1f339541ffee800f67a36ae2b4674a02c49dd8ef /src
parentb2c710add941f2db703d28b1eaab2ef2d7a2aa46 (diff)
downloadrspamd-f94a016916b5f2b08d15c46d2cada9149507f16b.tar.gz
rspamd-f94a016916b5f2b08d15c46d2cada9149507f16b.zip
* Fix patterns matching in lua plugins
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/once_received.lua2
-rw-r--r--src/plugins/lua/received_rbl.lua4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/lua/once_received.lua b/src/plugins/lua/once_received.lua
index 86be20380..2a239a7d0 100644
--- a/src/plugins/lua/once_received.lua
+++ b/src/plugins/lua/once_received.lua
@@ -15,7 +15,7 @@ function check_quantity_received (task)
if symbol_strict then
local r = recvh[1]
-- Unresolved host
- if not r['real_hostname'] or r['real_hostname'] == 'unknown' or string.match(r['real_hostname'], '(%d+)\.(%d+)\.(%d+)\.(%d+)') then
+ if not r['real_hostname'] or r['real_hostname'] == 'unknown' or string.match(r['real_hostname'], '^%d+%.%d+%.%d+%.%d+$') then
task:insert_result(metric, symbol_strict, 1)
end
local i = true
diff --git a/src/plugins/lua/received_rbl.lua b/src/plugins/lua/received_rbl.lua
index 9165d219d..1e0f7d4d6 100644
--- a/src/plugins/lua/received_rbl.lua
+++ b/src/plugins/lua/received_rbl.lua
@@ -13,7 +13,7 @@ local rbls = {}
function dns_cb(task, to_resolve, results, err)
if results then
- local _,_,rbl = string.find(to_resolve, '%d+\.%d+\.%d+\.%d+\.(.+)')
+ local _,_,rbl = string.find(to_resolve, '%d+%.%d+%.%d+%.%d+%.(.+)')
task:insert_result(metric, symbol, 1, rbl)
end
end
@@ -23,7 +23,7 @@ function received_cb (task)
for _,rh in ipairs(recvh) do
for k,v in pairs(rh) do
if k == 'real_ip' then
- local _,_,o1,o2,o3,o4 = string.find(v, '(%d+)\.(%d+)\.(%d+)\.(%d+)')
+ local _,_,o1,o2,o3,o4 = string.find(v, '(%d+)%.(%d+)%.(%d+)%.(%d+)')
for _,rbl in ipairs(rbls) do
rbl_str = o4 .. '.' .. o3 .. '.' .. o2 .. '.' .. o1 .. '.' .. rbl
task:resolve_dns_a(rbl_str, 'dns_cb')