From b1acff08a399b98243f1213e58a0b95a8211e953 Mon Sep 17 00:00:00 2001 From: Saulius Gurklys Date: Sun, 22 Oct 2023 02:22:49 +0300 Subject: [PATCH] UTC format timestamps in headers (#404) (#406) This change makes all header timestamps (e.g. "Received") to use UTC time zone. This way the length of such headers do not depend on local time zone which if effect fixes #404. Signed-off-by: Saulius Gurklys --- pkg/server/smtp/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/server/smtp/handler.go b/pkg/server/smtp/handler.go index f0aea40..3cb9750 100644 --- a/pkg/server/smtp/handler.go +++ b/pkg/server/smtp/handler.go @@ -533,7 +533,7 @@ func (s *Session) dataHandler() { mailData := bytes.NewBuffer(msgBuf) // Mail data complete. - tstamp := time.Now().Format(timeStampFormat) + tstamp := time.Now().UTC().Format(timeStampFormat) for _, recip := range s.recipients { if recip.ShouldStore() { // Generate Received header.