Skip to content

Commit 733cd01

Browse files
committed
Added test case for invalid/empty nested outlook message attachment (issue 396)
1 parent d981f27 commit 733cd01

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

modules/simple-java-mail/src/test/java/org/simplejavamail/converter/EmailConverterTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,24 @@ public void testOutlookMessageWithEmptyAttachments() {
129129
}
130130

131131
@Test
132-
public void testIt() {
132+
public void testProblematicEmbeddedImage() {
133133
Email s1 = EmailConverter.emlToEmail(new File(RESOURCE_TEST_MESSAGES + "/#332 Email with problematic embedded image.eml"));
134134
assertThat(s1.getAttachments()).isEmpty();
135135
assertThat(s1.getEmbeddedImages()).extracting("name")
136136
.containsExactly("DB294AA3-160F-4825-923A-B16C8B674543@home");
137137
assertThat(s1.getHTMLText()).containsPattern("\"cid:DB294AA3-160F-4825-923A-B16C8B674543@home\"");
138138
}
139139

140+
@Test
141+
public void testProblematicExchangeDeliveryReceipts() throws Exception {
142+
SecureTestDataHelper.runTestWithSecureTestData(passwords -> {
143+
String fileNameMsg = RESOURCES + "/secure-testdata/secure-testdata/nested-empty-outlook-msg/Outlook msg with empty nested msg attachment.msg";
144+
Email email = EmailConverter.outlookMsgToEmail(new File(fileNameMsg));
145+
assertThat(email.getAttachments()).isEmpty();
146+
assertThat(email.getDecryptedAttachments()).isEmpty();
147+
});
148+
}
149+
140150
@Test
141151
public void testContentTransferEncodingQuotedPrintable() throws IOException {
142152
ConfigLoaderTestHelper.clearConfigProperties();
Binary file not shown.

0 commit comments

Comments
 (0)