greenmail icon indicating copy to clipboard operation
greenmail copied to clipboard

Integrate fixes from Alfresco patch

Open marcelmay opened this issue 10 years ago • 6 comments

Alfresco patched GreenMail for various issues.

Evaluate and reintegrate the ~~patch~~ patch.

marcelmay avatar Dec 08 '14 21:12 marcelmay

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)~~

marcelmay avatar Dec 27 '14 22:12 marcelmay

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 avatar Feb 27 '15 16:02 markrogersalfresco

@markrogersalfresco Hi - do you have any tests that go along with the patches you mentioned in #46?

Thanks, Youssuf

buildscientist avatar Oct 18 '15 17:10 buildscientist

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 avatar Aug 21 '16 19:08 vguna

@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.

marcelmay avatar Aug 21 '16 19:08 marcelmay

Yeah, you're right :). Interesting why the encoding isn't working for me using GMU. I'll have to recheck...

vguna avatar Aug 23 '16 20:08 vguna