From 8cc12e869a0b3f171ec8d08bab486a88c6788c4f Mon Sep 17 00:00:00 2001 From: Stefan Benz <46600784+stebenz@users.noreply.github.com> Date: Thu, 2 May 2024 10:36:21 +0200 Subject: [PATCH] fix: correct email headers (mime version and content-type) (#7886) * fix: correct email mime version case for case-sensitive handlers * remove trailing `;` --------- Co-authored-by: Livio Spring --- internal/notification/messages/email.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/notification/messages/email.go b/internal/notification/messages/email.go index cd3f362f82..54b5aae22c 100644 --- a/internal/notification/messages/email.go +++ b/internal/notification/messages/email.go @@ -51,9 +51,9 @@ func (msg *Email) GetContent() (string, error) { } //default mime-type is html - mime := "MIME-version: 1.0;" + lineBreak + "Content-Type: text/html; charset=\"UTF-8\";" + lineBreak + lineBreak + mime := "MIME-Version: 1.0" + lineBreak + "Content-Type: text/html; charset=\"UTF-8\"" + lineBreak + lineBreak if !isHTML(msg.Content) { - mime = "MIME-version: 1.0;" + lineBreak + "Content-Type: text/plain; charset=\"UTF-8\";" + lineBreak + lineBreak + mime = "MIME-Version: 1.0" + lineBreak + "Content-Type: text/plain; charset=\"UTF-8\"" + lineBreak + lineBreak } subject := "Subject: " + bEncodeSubject(msg.Subject) + lineBreak message += subject + mime + lineBreak + msg.Content