Add test case for multipart/mixed email containing text-plain part
diff --git a/parsemail_test.go b/parsemail_test.go
index e0457bb..b002a28 100644
--- a/parsemail_test.go
+++ b/parsemail_test.go
@@ -245,6 +245,24 @@
},
},
},
+ 8: {
+ mailData: data3,
+ subject: "Re: kern/54143 (virtualbox)",
+ from: []mail.Address{
+ {
+ Name: "Rares",
+ Address: "rares@example.com",
+ },
+ },
+ to: []mail.Address{
+ {
+ Name: "",
+ Address: "bugs@example.com",
+ },
+ },
+ date: parseDate("Fri, 02 May 2019 11:25:35 +0300"),
+ textBody: `plain text part`,
+ },
}
for index, td := range testData {
@@ -587,6 +605,19 @@
--------------C70C0458A558E585ACB75FB4--
`
+var data3 = `From: Rares <rares@example.com>
+Date: Thu, 2 May 2019 11:25:35 +0300
+Subject: Re: kern/54143 (virtualbox)
+To: bugs@example.com
+Content-Type: multipart/mixed; boundary="0000000000007e2bb40587e36196"
+
+--0000000000007e2bb40587e36196
+Content-Type: text/plain; charset="UTF-8"
+
+plain text part
+--0000000000007e2bb40587e36196--
+`
+
var rfc5322exampleA11 = `From: John Doe <jdoe@machine.example>
Sender: Michael Jones <mjones@machine.example>
To: Mary Smith <mary@example.net>