Skip to content

Commit 1e5bea9

Browse files
committed
Updated outlook dependency which fixes issue with garbage from sender if the email was not sent and mishandled to name/address if the address was supplied as the name
1 parent fcfb94d commit 1e5bea9

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

modules/outlook-module/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<dependency>
3232
<groupId>org.simplejavamail</groupId>
3333
<artifactId>outlook-message-parser</artifactId>
34-
<version>1.7.1</version>
34+
<version>1.7.3</version>
3535
</dependency>
3636
</dependencies>
3737

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,44 @@ public void testOutlookBasicConversions() {
3333
assertThat(normalizeNewlines(msg.getHTMLText())).isEqualTo("<div dir=\"auto\">Just a test to get an email with one cc recipient.</div>\n");
3434
assertThat(normalizeNewlines(msg.getPlainText())).isEqualTo("Just a test to get an email with one cc recipient.\n");
3535
}
36+
37+
@Test
38+
public void testOutlookUnicode() {
39+
final Recipient kalejs = new Recipient("[email protected]", "[email protected]", null);
40+
final Recipient dummy = new Recipient("[email protected]", "[email protected]", TO);
41+
42+
@NotNull Email msg = EmailConverter.outlookMsgToEmail(new File(RESOURCE_FOLDER + "/tst_unicode.msg"));
43+
EmailAssert.assertThat(msg).hasFromRecipient(kalejs);
44+
EmailAssert.assertThat(msg).hasSubject("Testcase");
45+
EmailAssert.assertThat(msg).hasOnlyRecipients(dummy);
46+
EmailAssert.assertThat(msg).hasNoAttachments();
47+
assertThat(msg.getPlainText()).isNotEmpty();
48+
assertThat(normalizeNewlines(msg.getHTMLText())).isNotEmpty();
49+
assertThat(normalizeNewlines(msg.getPlainText())).isEqualTo("-/-\n" +
50+
"Char-å-Char\n" +
51+
"-/-\n" +
52+
"Char-Å-Char\n" +
53+
"-/-\n" +
54+
"Char-ø-Char\n" +
55+
"-/-\n" +
56+
"Char-Ø-Char\n" +
57+
"-/-\n" +
58+
"Char-æ-Char\n" +
59+
"-/-\n" +
60+
"Char-Æ-Char\n" +
61+
" \n");
62+
}
63+
64+
@Test
65+
public void testOutlookUnsentDraft() {
66+
final Recipient time2talk = new Recipient("[email protected]", "[email protected]", TO);
67+
68+
@NotNull Email msg = EmailConverter.outlookMsgToEmail(new File(RESOURCE_FOLDER + "/unsent draft.msg"));
69+
EmailAssert.assertThat(msg).hasFromRecipient(new Recipient(null, "[email protected]", null));
70+
EmailAssert.assertThat(msg).hasSubject("MSG Test File");
71+
EmailAssert.assertThat(msg).hasOnlyRecipients(time2talk);
72+
EmailAssert.assertThat(msg).hasNoAttachments();
73+
assertThat(msg.getPlainText()).isNotEmpty();
74+
assertThat(normalizeNewlines(msg.getHTMLText())).isNotEmpty();
75+
}
3676
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)