Browse Source

[Fix] Rbl: Allow utf8 lookups for IDN domains

Issue: #3137
tags/2.2
Vsevolod Stakhov 4 years ago
parent
commit
1ee4b15943
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/plugins/lua/rbl.lua

+ 5
- 2
src/plugins/lua/rbl.lua View File

@@ -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

Loading…
Cancel
Save