From: Vsevolod Stakhov Date: Tue, 5 Nov 2019 10:50:34 +0000 (+0000) Subject: [Fix] Rbl: Allow utf8 lookups for IDN domains X-Git-Tag: 2.2~83 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1ee4b159437edc1d991860008371f587c3283cda;p=rspamd.git [Fix] Rbl: Allow utf8 lookups for IDN domains Issue: #3137 --- 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