From: Vsevolod Stakhov Date: Sat, 29 Mar 2014 23:09:36 +0000 (-0700) Subject: Fix plugins. X-Git-Tag: 0.6.10~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6c70c2b380fd0b1d376e576507f1de5723d8c04d;p=rspamd.git Fix plugins. --- diff --git a/src/plugins/lua/ip_score.lua b/src/plugins/lua/ip_score.lua index 374714bc5..ab8258a89 100644 --- a/src/plugins/lua/ip_score.lua +++ b/src/plugins/lua/ip_score.lua @@ -40,7 +40,7 @@ local ip_score_set = function(task) if action then -- Check whitelist if whitelist then - local ipnum = task:get_from_ip_num() + local ipnum = task:get_from_ip():to_number() if ipnum and whitelist:get_key(ipnum) then -- Address is whitelisted return @@ -103,7 +103,7 @@ local ip_score_check = function(task) local ip = task:get_from_ip() if ip then if whitelist then - local ipnum = task:get_from_ip_num() + local ipnum = task:get_from_ip():to_number() if whitelist:get_key(ipnum) then -- Address is whitelisted return diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 1711c212e..4ad8766f5 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -28,7 +28,7 @@ local function check_multimap(task) task:insert_result(rule['symbol'], 1) end else - local ip = task:get_from_ip_num() + local ip = task:get_from_ip():to_number() if ip and rule['ips'] and rule['ips']:get_key(ip) then task:insert_result(rule['symbol'], 1) end diff --git a/src/plugins/lua/whitelist.lua b/src/plugins/lua/whitelist.lua index 5b8fe4fcb..84adada72 100644 --- a/src/plugins/lua/whitelist.lua +++ b/src/plugins/lua/whitelist.lua @@ -9,7 +9,7 @@ local h = nil -- radix tree and hash table local function check_whitelist (task) if symbol_ip then -- check client's ip - local ipn = task:get_from_ip_num() + local ipn = task:get_from_ip():to_number() if ipn then local key = r:get_key(ipn) if key then