[Rspamd] Check if ip is valid (KEEP_SPAM symbol), fixes #1759

This commit is contained in:
André 2018-09-12 15:50:42 +02:00
parent 1499094b61
commit 1b5409f3fa

View File

@ -23,11 +23,11 @@ rspamd_config:register_symbol({
local redis_params = rspamd_parse_redis_server('keep_spam') local redis_params = rspamd_parse_redis_server('keep_spam')
local ip = task:get_from_ip() local ip = task:get_from_ip()
if not ip then if not ip:is_valid() then
return false return false
end end
local from_ip_string = ip:to_string() local from_ip_string = tostring(ip)
ip_check_table = {from_ip_string} ip_check_table = {from_ip_string}
local maxbits = 128 local maxbits = 128