From e471e2a1cc384f6b4a505fd3483de1d89c4bd3d6 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 6 Oct 2025 11:27:43 +0100 Subject: [PATCH] [Fix] aliases: correct to_local when no recipients present --- lualib/lua_aliases.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 -- 2.47.3