Hi What version of Camel are you using?
We have improved the camel-mail component quite a bit lately. Can you try with 1.6.1 or 2.0m3? On Fri, Jul 31, 2009 at 2:27 PM, dcheckoway<dchecko...@gmail.com> wrote: > > I'm using Camel Mail to route email messages to a handler. Works > perfectly...but I've bumped into an issue whenever somebody sends an email > with an unsupported charset. For example: > > Content-type: text/plain; charset=ansi_x3.110-1983 > > ...and since JDK6 has no idea wtf charset that is, I get the following > exception: > > Caused by: java.io.UnsupportedEncodingException: ansi_x3.110-1983 > at > sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:52) > at java.io.InputStreamReader.<init>(InputStreamReader.java:83) > at com.sun.mail.handlers.text_plain.getContent(text_plain.java:82) > at > javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:775) > at javax.activation.DataHandler.getContent(DataHandler.java:522) > at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1380) > at > org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:108) > > This wouldn't be such a big deal if it wasn't for the fact that Camel is now > totally hosed and can't "move past" that one message in the inbox. Every > time it subsequently polls the inbox, it throws that same exception and > bails. It can't access any other messages at that point. I'm forced to go > in and manually delete that one message so that Camel can continue > processing the inbox. > > So here are my questions... > > 1. Is there any way I can somehow intercept/filter the route and manually > tweak the Content-Type header on the MimeMessage? I would happily munge the > charset to a known value if I could... > > 2. Is there any way Camel's behavior can be configured to "ignore messages > on error" or something like that? > > 3. Is there any way I can add Charset support for ansi_x3.110-1983? Seems > like that would be the ideal solution. > > For what it's worth, here's my route: > > from("imaps://imap.gmail.com?" + > "username=" + username + > "&password=" + password + > "&deleteProcessedMessages=false" + > "&processOnlyUnseenMessages=true" + > "&consumer.delay=10003") > .process(handler); > > Thanks in advance for your help! > -- > View this message in context: > http://www.nabble.com/Camel-Mail-issue-with-unsupported-charset-tp24755585p24755585.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus