From c6d85fec1cdc2130f60bcd4862e3d921cc1b0918 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sun, 12 Jan 2025 11:09:48 +0100 Subject: [PATCH] #412: Fix regression in multipart boundary writing This fixes a regression that was introduced in the S/MIME signing code of v0.6.0 which caused the msgwriter to not add a newline between the first boundary and the multipart causing the mail to be unable to render in mail clients. --- msgwriter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/msgwriter.go b/msgwriter.go index da784ef4..e9a80cd9 100644 --- a/msgwriter.go +++ b/msgwriter.go @@ -141,19 +141,19 @@ func (mw *msgWriter) writeMsg(msg *Msg) { } if msg.hasMixed() { mw.startMP(MIMEMixed, msg.boundary) - if mw.depth == 0 || (msg.hasSMIME() && mw.depth == 1) { + if mw.depth == 1 { mw.writeString(DoubleNewLine) } } if msg.hasRelated() { mw.startMP(MIMERelated, msg.boundary) - if mw.depth == 0 || (msg.hasSMIME() && mw.depth == 1) { + if mw.depth == 1 { mw.writeString(DoubleNewLine) } } if msg.hasAlt() { mw.startMP(MIMEAlternative, msg.boundary) - if mw.depth == 0 || (msg.hasSMIME() && mw.depth == 1) { + if mw.depth == 1 { mw.writeString(DoubleNewLine) } }