Hi yikes ugly story.
Could you create a JIRA ticket and attach your patch. And if you have any kind of unit test that can verify this that would be great as well. On Mon, Nov 9, 2009 at 2:17 PM, dcheckoway <dchecko...@gmail.com> wrote: > > Claus, > > Thanks...that got us further along but didn't quite work. I finally got my > butt in gear and started doing camel builds, and I managed to get this > problem fixed. Here's the scoop: > > The Message instance we're working with is read-only. So when calling > setHeader it threw: > > javax.mail.IllegalWriteException: IMAPMessage is read-only > at com.sun.mail.imap.IMAPMessage.setHeader(IMAPMessage.java:739) > ... > > The fix was to make a copy of the message object, and then we can modify the > copy. But that's not all there is to it. The problem cascaded out into > other accessors down the line, i.e. when headers and attachments get > processed. Those actions would bump into the same > UnsupportedEncodingException, because they're working with that same > original instance of Message that has the funky charset. > > So...the key is to call MailMessage.setMessage(ourModifiedInstance) so that > the modified copy gets used in other calls down the line. > > But...of course that introduced a new problem: when marking the message > "SEEN" we were now marking the *copy* seen, not the original. So it was > necessary for MailMessage to hold not only the modified instance, but also > the original Message instance, so that MailConsumer.processCommit could > setFlag on the original. Otherwise, the message never got marked read. > > Attached is a patch for camel/trunk that works. > http://old.nabble.com/file/p26266245/dcheckoway-charset-fix.diff > dcheckoway-charset-fix.diff > > Thanks for all your help on this and for putting up with me. Maybe someday > I can become a committer... :-) > > Dan > > > > Claus Ibsen-2 wrote: >> >> On Sun, Nov 8, 2009 at 9:38 AM, dcheckoway <dchecko...@gmail.com> wrote: >>> >>> Sorry, I haven't yet. I've been bogged with other stuff and haven't even >>> looked into how to build camel from source...excuses, excuses. I hope to >>> get around to it in the next week or so and will definitely let you know! >>> >> >> Hi >> >> I have attached a .jar with a fix I have just coded. Can you test it >> on your system. >> The commit is rev 833857. >> > -- > View this message in context: > http://old.nabble.com/Camel-Mail-issue-with-unsupported-charset-tp24755585p26266245.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus