Skip to content

Commit

Permalink
Merge pull request #6 from ggarciajr/rodrigo.fix-nested-multipart-mixed
Browse files Browse the repository at this point in the history
Feat: Fix nested multipart mixed
  • Loading branch information
tatorodrigo authored Dec 12, 2022
2 parents 4286f6d + 3a024a7 commit 2117997
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions parsemail.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,19 @@ func parseMultipartMixed(msg io.Reader, boundary string) (textBody, htmlBody str
}

htmlBody += strings.TrimSuffix(string(ppContent[:]), "\n")
} else if contentType == contentTypeMultipartMixed {
textBody2, htmlBody2, attachments2, embeddedFiles2, err := parseMultipartMixed(part, params["boundary"])
if err != nil {
return textBody, htmlBody, attachments, embeddedFiles, err
}
textBody += textBody2
htmlBody += htmlBody2
if attachments2 != nil {
attachments = append(attachments, attachments2...)
}
if embeddedFiles2 != nil {
embeddedFiles = append(embeddedFiles, embeddedFiles2...)
}
} else if isAttachment(part) {
at, err := decodeAttachment(part)
if err != nil {
Expand Down

0 comments on commit 2117997

Please sign in to comment.