Skip to content

Commit

Permalink
[Minor] Use utf8 compatible comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Apr 25, 2023
1 parent 0a0e3f3 commit 0170406
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/lua/forged_recipients.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ end

local symbol_rcpt = 'FORGED_RECIPIENTS'
local symbol_sender = 'FORGED_SENDER'
local rspamd_util = require "rspamd_util"

local E = {}

Expand Down Expand Up @@ -141,7 +142,7 @@ local function check_forged_headers(task)
if smtp_from and smtp_from[1] and smtp_from[1]['addr'] ~= '' then
local mime_from = task:get_from(2)
if not mime_from or not mime_from[1] or
(string.lower(mime_from[1]['addr']) ~= string.lower(smtp_from[1]['addr'])) then
not rspamd_util.strequal_caseless_utf8(mime_from[1]['addr'], smtp_from[1]['addr']) then
task:insert_result(symbol_sender, 1, ((mime_from or E)[1] or E).addr or '', smtp_from[1].addr)
end
end
Expand Down

0 comments on commit 0170406

Please sign in to comment.