From 5a81e2cb1e29d7826b081c81116e2e92104aac8b Mon Sep 17 00:00:00 2001 From: Conrad Hoffmann Date: Mon, 18 Nov 2024 14:13:44 +0100 Subject: [PATCH] email: set Content-Type to format=flowed This allows us to start sending emails in flowed format. It does not actually change anything, until the templates in the services get updated. As format=flowed is designed to be backwards-compatible, it also doesn't break anything. All emails will still look like before, with static line breaks. However, changing the templates to flowed will now produce emails that render as flowed successfully. Tested on plain (signed) and encrypted mails. See https://www.ietf.org/rfc/rfc2646.txt --- email/worker.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/email/worker.go b/email/worker.go index bb74a0ca183a5ac628111802e4d122287cc176b4..4f3501b5b0bf94d7f28486944601ff3b1cd7388c 100644 --- a/email/worker.go +++ b/email/worker.go @@ -146,7 +146,10 @@ func EnqueueStd(ctx context.Context, header mail.Header, defer cleartext.Close() var inlineHeader mail.Header - inlineHeader.SetContentType("text/plain", map[string]string{"charset": "UTF-8"}) + inlineHeader.SetContentType("text/plain", map[string]string{ + "charset": "UTF-8", + "format": "flowed", + }) body, err := mail.CreateSingleInlineWriter(cleartext, inlineHeader) if err != nil { panic(err)