소스 검색

More checks in lua plugins.

tags/0.4.2
Vsevolod Stakhov 13 년 전
부모
커밋
5a334d3e12
2개의 변경된 파일11개의 추가작업 그리고 7개의 파일을 삭제
  1. 6
    4
      src/plugins/lua/once_received.lua
  2. 5
    3
      src/plugins/lua/received_rbl.lua

+ 6
- 4
src/plugins/lua/once_received.lua 파일 보기

@@ -28,10 +28,12 @@ function check_quantity_received (task)
for _,h in ipairs(bad_hosts) do
if string.find(hn, h) then
-- Check for good hostname
for _,gh in ipairs(good_hosts) do
if string.find(hn, gh) then
i = false
break
if good_hosts then
for _,gh in ipairs(good_hosts) do
if string.find(hn, gh) then
i = false
break
end
end
end
if i then

+ 5
- 3
src/plugins/lua/received_rbl.lua 파일 보기

@@ -22,9 +22,11 @@ function received_cb (task)
for _,rh in ipairs(recvh) do
if rh['real_ip'] then
local _,_,o1,o2,o3,o4 = string.find(rh['real_ip'], '^(%d+)%.(%d+)%.(%d+)%.(%d+)$')
for _,rbl in ipairs(rbls) do
rbl_str = o4 .. '.' .. o3 .. '.' .. o2 .. '.' .. o1 .. '.' .. rbl['rbl']
task:resolve_dns_a(rbl_str, 'dns_cb', rbl['symbol'])
if o1 and o2 and o3 and o4 then
for _,rbl in ipairs(rbls) do
rbl_str = o4 .. '.' .. o3 .. '.' .. o2 .. '.' .. o1 .. '.' .. rbl['rbl']
task:resolve_dns_a(rbl_str, 'dns_cb', rbl['symbol'])
end
end
end
end

Loading…
취소
저장