Fix email header date (zone offset)

This commit is contained in:
Alfredo Cardigliano 2024-01-29 09:42:40 +01:00
parent bc2f2a3577
commit 5b0af53702
2 changed files with 36 additions and 2 deletions

View file

@ -70,14 +70,13 @@ end
-- ##############################################
local function buildMessageHeader(now_ts, from, to, cc, subject, body)
local now = os.date("%a, %d %b %Y %X", now_ts) -- E.g. "Tue, 3 Apr 2018 14:58:00"
local msg_id = "<" .. now_ts .. "." .. os.clock() .. "@ntopng>"
local lines = {
"From: " .. from,
"To: " .. to,
"Subject: " .. subject,
"Date: " .. now,
"Date: " .. format_utils.formatEpochRFC2822(now_ts),
"Message-ID: " .. msg_id,
"Content-Type: text/html; charset=UTF-8",
}