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");