diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-05 10:50:34 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-05 10:50:34 +0000 |
commit | 1ee4b159437edc1d991860008371f587c3283cda (patch) | |
tree | 16646903d101f00c1c4e1b360150b6b309fc432b | |
parent | d3f32d995e23b0d7e268b875b56811b326334745 (diff) | |
download | rspamd-1ee4b159437edc1d991860008371f587c3283cda.tar.gz rspamd-1ee4b159437edc1d991860008371f587c3283cda.zip |
[Fix] Rbl: Allow utf8 lookups for IDN domains
Issue: #3137
-rw-r--r-- | src/plugins/lua/rbl.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index 623de0a37..521e63708 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -70,9 +70,12 @@ local function validate_dns(lstr) -- two dots in a row return false end + if not rspamd_util.is_valid_utf8(lstr) then + -- invalid utf8 detected + return false + end for v in lstr:gmatch('[^%.]+') do - if not v:match('^[%w-]+$') or v:len() > 63 - or v:match('^-') or v:match('-$') then + if v:len() > 63 or v:match('^-') or v:match('-$') then -- too long label or weird labels return false end |