greenmail-mail-test / greenmail

Official master for the Greenmail project
http://greenmail-mail-test.github.io/greenmail/
Apache License 2.0
629 stars 181 forks source link

Integrate fixes from Alfresco patch #37

Open marcelmay opened 9 years ago

marcelmay commented 9 years ago

Alfresco patched GreenMail for various issues.

Evaluate and reintegrate the patch patch.

marcelmay commented 9 years ago

Patch analysis:

Investigate

markrogersalfresco commented 9 years ago

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.

buildscientist commented 8 years ago

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

Thanks, Youssuf

vguna commented 8 years ago

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.

marcelmay commented 8 years ago

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

vguna commented 8 years ago

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