From: Vsevolod Stakhov Date: Mon, 6 Oct 2025 10:27:43 +0000 (+0100) Subject: [Fix] aliases: correct to_local when no recipients present X-Git-Tag: 3.14.0~88^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e471e2a1cc384f6b4a505fd3483de1d89c4bd3d6;p=thirdparty%2Frspamd.git [Fix] aliases: correct to_local when no recipients present --- diff --git a/lualib/lua_aliases.lua b/lualib/lua_aliases.lua index f5a467983e..3a98316b9c 100644 --- a/lualib/lua_aliases.lua +++ b/lualib/lua_aliases.lua @@ -863,15 +863,14 @@ local function classify_message(task, opts) local rcpts_smtp = task:get_recipients('smtp') if rcpts_smtp then local any_local = false - local all_local = true + local rcpt_count = 0 for _, rcpt in ipairs(rcpts_smtp) do + rcpt_count = rcpt_count + 1 -- Check if recipient is local local rcpt_is_local = is_local_address(rcpt) if rcpt_is_local then any_local = true - else - all_local = false end -- Resolve recipient @@ -896,7 +895,7 @@ local function classify_message(task, opts) }) end - classification.to_local = any_local or all_local + classification.to_local = (rcpt_count > 0) and any_local end -- Determine direction