You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by axelr <ar...@ordix.de> on 2013/01/05 08:24:18 UTC

MailConverters fails with uppercase content type TEXT/PLAIN?

Hi,

I am wondering why the MailComponent fails to extract the text body of a
simple (multipart) mail:

TRACE [Camel - imaps://...] org.apache.camel.component.mail.MailBinding:
Part #0: ContentType: TEXT/PLAIN; charset=utf-8

INFO  [Camel - imaps://...] de.ordix: Exchange[ExchangePattern:InOnly,
BodyType:javax.mail.internet.MimeMultipart,
Body:javax.mail.internet.MimeMultipart@1d8c8b4]

And in MailConverters.java line 72 I found:
/if (part.getContentType().startsWith("text")) {/

[Of course /.convertBodyTo(String.class)/ doesn't change the situation.]

Ok, one solution could be to blame the email client ...

But would it be wrong to change the handling within the MailConverters to
ignorecase?

Best regards
Axel



--
View this message in context: http://camel.465427.n5.nabble.com/MailConverters-fails-with-uppercase-content-type-TEXT-PLAIN-tp5724938.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: MailConverters fails with uppercase content type TEXT/PLAIN?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi



On Sat, Jan 5, 2013 at 8:24 AM, axelr <ar...@ordix.de> wrote:
> Hi,
>
> I am wondering why the MailComponent fails to extract the text body of a
> simple (multipart) mail:
>
> TRACE [Camel - imaps://...] org.apache.camel.component.mail.MailBinding:
> Part #0: ContentType: TEXT/PLAIN; charset=utf-8
>
> INFO  [Camel - imaps://...] de.ordix: Exchange[ExchangePattern:InOnly,
> BodyType:javax.mail.internet.MimeMultipart,
> Body:javax.mail.internet.MimeMultipart@1d8c8b4]
>
> And in MailConverters.java line 72 I found:
> /if (part.getContentType().startsWith("text")) {/
>
> [Of course /.convertBodyTo(String.class)/ doesn't change the situation.]
>
> Ok, one solution could be to blame the email client ...
>
> But would it be wrong to change the handling within the MailConverters to
> ignorecase?
>

No I think we should fix camel-mail to ignore cases. There is a ton of
edge cases with emails.

Feel free to log a JIRA ticket.

And as always we love contributions
http://camel.apache.org/contributing.html


> Best regards
> Axel
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/MailConverters-fails-with-uppercase-content-type-TEXT-PLAIN-tp5724938.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen