greenmail
greenmail copied to clipboard
Integrate fixes from Alfresco patch
Patch analysis:
- ~~Fix for Date parsing in CommandParser~~ (already fixed, but should also include 'Z' additionally to 'zzzz', as by Spec. Use MailDateFormat! Fixed in #53 )
- ~~Fix for leaking handler in AbstractServer~~ (already fixed in #18 and release 1.4)
- ~~Fix for Umlauts in Subject~~ (fixed in #71)
Investigate
- CommandParser/ImapRequestLineReader and byte[] vs char[] reading, eg. in method consumeLiteralAsBytes
- CommandParser.flagList and '(' / ')' handling
- FetchCommand.handleBodyFetch TODOs
- imap.FetchCommand.FetchCommandParser '(' / ')' handling and addNextElement(...) '<' handling.
- imap.ListCommand related to marked/unmarked ~~and quoting handling~~ (quoting fixed in #74 )
- imap.SelectCommand and UIDVALIDITY/UIDNEXT/PERMANENTFLAGS handling
- ~~imap.StatusCommand and quoting mailbox name~~ (quoting fixed in #74 )
- ImapHandler, ImapResponse and EIGHT_BIT_ENCODING/ASCII handling (see #32)
- ImapSessionFolder.getMsn
- SimpleMessageAttributes.parseMimePart MimeMessage handling ~~and address quotes handling~~
- GreenMailUtil and EIGHT_BIT_ENCODING (see #32)
- ~~CopyCommand UID support (see #114)~~
If you need more details of why we have patched what we have then it will be in Alfresco's JIRA. I can probably give details. We should also have integration tests that could be adapted.
I'll start by contributing an easy fix just to get the ball rolling.
@markrogersalfresco Hi - do you have any tests that go along with the patches you mentioned in #46?
Thanks, Youssuf
Using 1.5.1 here facing the problem described here (encodings):
https://github.com/greenmail-mail-test/greenmail/issues/32
Body contains german umlauts. Using GreenMailUtil.getBody(mimeMessage)
shows raw encodings like
Bitte best=C3=A4tigen Sie die Registrierung durch einen Klick auf u.a. Link=.
Currently working around using Spring's MimeMessageHelper
like that:
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage);
String body = helper.getMimeMessage().getContent();
Returns Bitte bestätigen Sie die Registrierung durch einen Klick auf u.a. Link.
@vguna , why not use plain JavaMail for getting the content:
mimeMessage.getContent()
MimeMessageHelper#getMimeMessage() directly returns the wrapped mime message, so you could leave out the MMH wrapper.
I'll look into GMU.getBody, looks like it is returning the raw mail content.
You can check out the test case for umlauts.
Yeah, you're right :). Interesting why the encoding isn't working for me using GMU. I'll have to recheck...