From e66399fe667c756306688479b674c2e097130a6d Mon Sep 17 00:00:00 2001 From: Boris Petrov Date: Tue, 7 Mar 2023 10:33:01 +0200 Subject: [PATCH] Set `mail.mime.decodefilename` in `testAttachmentWithUTF8NameAndGreenMailApi` --- .../com/icegreen/greenmail/specificmessages/EncodingTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/greenmail-core/src/test/java/com/icegreen/greenmail/specificmessages/EncodingTest.java b/greenmail-core/src/test/java/com/icegreen/greenmail/specificmessages/EncodingTest.java index 93117ef659..6df73c57aa 100644 --- a/greenmail-core/src/test/java/com/icegreen/greenmail/specificmessages/EncodingTest.java +++ b/greenmail-core/src/test/java/com/icegreen/greenmail/specificmessages/EncodingTest.java @@ -202,7 +202,9 @@ public void messagesAdded(MessageCountEvent e) { @Test public void testAttachmentWithUTF8NameAndGreenMailApi() throws MessagingException, IOException { greenMail.setUser("to@localhost", "pwd"); - final IMAPStore store = greenMail.getImap().createStore(); + final Session imapSession = greenMail.getImap().createSession(); + imapSession.getProperties().setProperty("mail.mime.decodefilename", "true"); + final IMAPStore store = (IMAPStore) imapSession.getStore(); store.connect("to@localhost", "pwd"); try { Folder inboxFolder = store.getFolder("INBOX");