From: Vsevolod Stakhov Date: Sat, 2 May 2026 12:39:07 +0000 (+0100) Subject: [Fix] dmarc: floor connect timestamp before os.date for PUC Lua X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc7423920c0801356db26798596b418fa6220c18;p=thirdparty%2Frspamd.git [Fix] dmarc: floor connect timestamp before os.date for PUC Lua task:get_date returns a fractional double; PUC-Rio Lua 5.3+ rejects non-integer floats as the second argument to os.date with "number has no integer representation". LuaJIT accepts it, so the bug only fires on the Fedora CI build. --- diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 64e7a6f15e..6c7c1e0cdc 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -295,8 +295,10 @@ local function dmarc_validate_policy(task, policy, hdrfromdom, dmarc_esld) end -- Prepare and send redis report element + -- math.floor is required: task:get_date returns a fractional double and + -- PUC-Rio Lua 5.3+ rejects non-integer floats as the second arg to os.date local period = os.date('%Y%m%d', - task:get_date({ format = 'connect', gmt = false })) + math.floor(task:get_date({ format = 'connect', gmt = false }))) -- Dmarc domain key must include dmarc domain, rua and period local dmarc_domain_key = table.concat(