Skip to content

Commit

Permalink
Feat: Handle nested multipart/mixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tatorodrigo committed Dec 12, 2022
1 parent 4286f6d commit 3a024a7
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 3a024a7

Please sign in to comment.