Skip to content

Commit

Permalink
#412: Fix regression in multipart boundary writing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wneessen committed Jan 12, 2025
1 parent fb1abbd commit c6d85fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions msgwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit c6d85fe

Please sign in to comment.