From a060abd5fe724a03b31215020fafdb7fd33724f5 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Fri, 9 Aug 2024 14:26:43 +1200 Subject: [PATCH] Fix: Correctly decode X-Tags message headers (RFC 2047) (#344) --- internal/storage/messages.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/storage/messages.go b/internal/storage/messages.go index 841b2873b..0007e1c69 100644 --- a/internal/storage/messages.go +++ b/internal/storage/messages.go @@ -50,7 +50,7 @@ func Store(body *[]byte) (string, error) { ReplyTo: addressToSlice(env, "Reply-To"), } - messageID := strings.Trim(env.Root.Header.Get("Message-ID"), "<>") + messageID := strings.Trim(env.GetHeader("Message-ID"), "<>") created := time.Now() // use message date instead of created date @@ -116,7 +116,7 @@ func Store(body *[]byte) (string, error) { tags := findTagsInRawMessage(body) if !config.TagsDisableXTags { - xTagsHdr := env.Root.Header.Get("X-Tags") + xTagsHdr := env.GetHeader("X-Tags") if xTagsHdr != "" { // extract tags from X-Tags header tags = append(tags, tools.SetTagCasing(strings.Split(strings.TrimSpace(xTagsHdr), ","))...)