[jira] [Commented] (CAMEL-9107) Exception thrown when reading a mail with an attached file, which name contains a semicolon

2020-01-04 Thread sophie (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-9107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17008204#comment-17008204
 ] 

sophie commented on CAMEL-9107:
---

has this java mail bug been fixed?  Otherwise i`m afraid we still need do the 
same workaround to avoid this bug. Do u know? Thx.

> Exception thrown when reading a mail with an attached file, which name 
> contains a semicolon
> ---
>
> Key: CAMEL-9107
> URL: https://issues.apache.org/jira/browse/CAMEL-9107
> Project: Camel
>  Issue Type: Bug
>  Components: camel-mail
>Affects Versions: 2.15.2
>Reporter: Thierry Frossard
>Assignee: Claus Ibsen
>Priority: Minor
> Fix For: Future
>
>
> Hi, 
> I posted this issue in Camel users forum but unfortunately got no response.
> I'm using Camel 2.15.2 with JDK 1.7 under Windows 7 and Eclipse 4.2.2 as 
> development tool. 
> My route reads from an IMAP server (IBM Lotus Notes). I have one big problem 
> : when the route handles an email, which contains a PDF attached file with a 
> semicolon in his name (for exemple my;pdf.pdf), then the route always throws 
> this exception : 
> Failed to extract body due to: Unable to load BODYSTRUCTURE. 
> 4.08.15 15:10:11:313 CEST] 0172 SystemOut O [15:10:11.313] WARN  
> [Camel (Mail vers Indexation) thread #0 - imap://myimapserver.ch] 
> org.apache.camel.util.CamelLogger.log:224 : Caused by: 
> [org.apache.camel.RuntimeCamelException - Failed to extract body due to: 
> Unable to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. 
> Message: com.sun.mail.imap.IMAPMessage@16e6c70e] 
> org.apache.camel.RuntimeCamelException: Failed to extract body due to: Unable 
> to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. Message: 
> com.sun.mail.imap.IMAPMessage@16e6c70e 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:275)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:103) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41) 
> ~[camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.createExchanges(MailConsumer.java:326)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:121) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:482) 
> [na:1.7.0] 
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:315) 
> [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:189)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
>  [na:1.7.0] 
> at java.lang.Thread.run(Thread.java:804) [na:1.7.0] 
> Caused by: javax.mail.MessagingException: Unable to load BODYSTRUCTURE 
> at 
> com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1261) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:597) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1395) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:247)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> ... 13 common frames omitted 
> Here is the route (very simple) : 
>   @Override 
>   public void configure() throws Exception { 
> from(getPropertiesUri()) 
> /**/.to("log:dummy"); 
>   } 
>   protected String getPropertiesUri() { 
> String prefix = Constants.MAIL.concat(provider); 
> StringBuilder uri = new StringBuilder(); 
> 
> uri.append(getContext().getProperties().get(prefix.concat(".protocol"))).append("://");
>  
> 
> uri.append(getContext().getProperties().get(prefix.concat(".host"))).append("?");
>  
> 
> uri.append("username=").append(getContext().getProperties().get(prefix.concat(".user")));
>  
> 
> uri.append("&password=").

[jira] [Commented] (CAMEL-9107) Exception thrown when reading a mail with an attached file, which name contains a semicolon

2016-04-30 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15265221#comment-15265221
 ] 

Claus Ibsen commented on CAMEL-9107:


Yes its in java mail that has a bug

> Exception thrown when reading a mail with an attached file, which name 
> contains a semicolon
> ---
>
> Key: CAMEL-9107
> URL: https://issues.apache.org/jira/browse/CAMEL-9107
> Project: Camel
>  Issue Type: Bug
>  Components: camel-mail
>Affects Versions: 2.15.2
>Reporter: Thierry Frossard
>Priority: Minor
> Fix For: Future
>
>
> Hi, 
> I posted this issue in Camel users forum but unfortunately got no response.
> I'm using Camel 2.15.2 with JDK 1.7 under Windows 7 and Eclipse 4.2.2 as 
> development tool. 
> My route reads from an IMAP server (IBM Lotus Notes). I have one big problem 
> : when the route handles an email, which contains a PDF attached file with a 
> semicolon in his name (for exemple my;pdf.pdf), then the route always throws 
> this exception : 
> Failed to extract body due to: Unable to load BODYSTRUCTURE. 
> 4.08.15 15:10:11:313 CEST] 0172 SystemOut O [15:10:11.313] WARN  
> [Camel (Mail vers Indexation) thread #0 - imap://myimapserver.ch] 
> org.apache.camel.util.CamelLogger.log:224 : Caused by: 
> [org.apache.camel.RuntimeCamelException - Failed to extract body due to: 
> Unable to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. 
> Message: com.sun.mail.imap.IMAPMessage@16e6c70e] 
> org.apache.camel.RuntimeCamelException: Failed to extract body due to: Unable 
> to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. Message: 
> com.sun.mail.imap.IMAPMessage@16e6c70e 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:275)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:103) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41) 
> ~[camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.createExchanges(MailConsumer.java:326)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:121) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:482) 
> [na:1.7.0] 
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:315) 
> [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:189)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
>  [na:1.7.0] 
> at java.lang.Thread.run(Thread.java:804) [na:1.7.0] 
> Caused by: javax.mail.MessagingException: Unable to load BODYSTRUCTURE 
> at 
> com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1261) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:597) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1395) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:247)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> ... 13 common frames omitted 
> Here is the route (very simple) : 
>   @Override 
>   public void configure() throws Exception { 
> from(getPropertiesUri()) 
> /**/.to("log:dummy"); 
>   } 
>   protected String getPropertiesUri() { 
> String prefix = Constants.MAIL.concat(provider); 
> StringBuilder uri = new StringBuilder(); 
> 
> uri.append(getContext().getProperties().get(prefix.concat(".protocol"))).append("://");
>  
> 
> uri.append(getContext().getProperties().get(prefix.concat(".host"))).append("?");
>  
> 
> uri.append("username=").append(getContext().getProperties().get(prefix.concat(".user")));
>  
> 
> uri.append("&password=").append(getContext().getProperties().get(prefix.concat(".password")));
>  
> 
> uri.append("&folderName=").append(get

[jira] [Commented] (CAMEL-9107) Exception thrown when reading a mail with an attached file, which name contains a semicolon

2016-04-28 Thread Thierry Frossard (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15263626#comment-15263626
 ] 

Thierry Frossard commented on CAMEL-9107:
-

Hello Claus,

That's exactly what we did : caught the exception and flagged the mail as
seen. Then we rename the attached files manually so that the mail can be
processed. The semicolon character is not a forbidden character in a file,
so isn't all this finally a bug in javamail ?

Best regards,

Thierry Frossard
Ingénieur de développement
Flux de données

Tél. 058/758.33.07
www.groupemutuel.ch


> Exception thrown when reading a mail with an attached file, which name 
> contains a semicolon
> ---
>
> Key: CAMEL-9107
> URL: https://issues.apache.org/jira/browse/CAMEL-9107
> Project: Camel
>  Issue Type: Bug
>  Components: camel-mail
>Affects Versions: 2.15.2
>Reporter: Thierry Frossard
>Priority: Minor
> Fix For: Future
>
>
> Hi, 
> I posted this issue in Camel users forum but unfortunately got no response.
> I'm using Camel 2.15.2 with JDK 1.7 under Windows 7 and Eclipse 4.2.2 as 
> development tool. 
> My route reads from an IMAP server (IBM Lotus Notes). I have one big problem 
> : when the route handles an email, which contains a PDF attached file with a 
> semicolon in his name (for exemple my;pdf.pdf), then the route always throws 
> this exception : 
> Failed to extract body due to: Unable to load BODYSTRUCTURE. 
> 4.08.15 15:10:11:313 CEST] 0172 SystemOut O [15:10:11.313] WARN  
> [Camel (Mail vers Indexation) thread #0 - imap://myimapserver.ch] 
> org.apache.camel.util.CamelLogger.log:224 : Caused by: 
> [org.apache.camel.RuntimeCamelException - Failed to extract body due to: 
> Unable to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. 
> Message: com.sun.mail.imap.IMAPMessage@16e6c70e] 
> org.apache.camel.RuntimeCamelException: Failed to extract body due to: Unable 
> to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. Message: 
> com.sun.mail.imap.IMAPMessage@16e6c70e 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:275)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:103) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41) 
> ~[camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.createExchanges(MailConsumer.java:326)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:121) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:482) 
> [na:1.7.0] 
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:315) 
> [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:189)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
>  [na:1.7.0] 
> at java.lang.Thread.run(Thread.java:804) [na:1.7.0] 
> Caused by: javax.mail.MessagingException: Unable to load BODYSTRUCTURE 
> at 
> com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1261) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:597) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1395) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:247)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> ... 13 common frames omitted 
> Here is the route (very simple) : 
>   @Override 
>   public void configure() throws Exception { 
> from(getPropertiesUri()) 
> /**/.to("log:dummy"); 
>   } 
>   protected String getPropertiesUri() { 
> String prefix = Constants.MAIL.concat(provider); 
> StringBuilder uri = new StringBuilder(); 
> 
> uri.append(getContext().getProperties().get(prefix.concat(".protocol"))

[jira] [Commented] (CAMEL-9107) Exception thrown when reading a mail with an attached file, which name contains a semicolon

2016-04-28 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15262223#comment-15262223
 ] 

Claus Ibsen commented on CAMEL-9107:


We could do a try .. catch to ignore when attempting to check the email for 
attachments. But this would cause that you cannot get the attachments from 
those invalid emails.

You cannot even read the mail body. What would you like to be able to do? That 
Camel has some option to ignore this so the route can process, and then at  the 
end mark the mail as SEEN so the consumer can pickup the next email?

> Exception thrown when reading a mail with an attached file, which name 
> contains a semicolon
> ---
>
> Key: CAMEL-9107
> URL: https://issues.apache.org/jira/browse/CAMEL-9107
> Project: Camel
>  Issue Type: Bug
>  Components: camel-mail
>Affects Versions: 2.15.2
>Reporter: Thierry Frossard
>Priority: Minor
> Fix For: Future
>
>
> Hi, 
> I posted this issue in Camel users forum but unfortunately got no response.
> I'm using Camel 2.15.2 with JDK 1.7 under Windows 7 and Eclipse 4.2.2 as 
> development tool. 
> My route reads from an IMAP server (IBM Lotus Notes). I have one big problem 
> : when the route handles an email, which contains a PDF attached file with a 
> semicolon in his name (for exemple my;pdf.pdf), then the route always throws 
> this exception : 
> Failed to extract body due to: Unable to load BODYSTRUCTURE. 
> 4.08.15 15:10:11:313 CEST] 0172 SystemOut O [15:10:11.313] WARN  
> [Camel (Mail vers Indexation) thread #0 - imap://myimapserver.ch] 
> org.apache.camel.util.CamelLogger.log:224 : Caused by: 
> [org.apache.camel.RuntimeCamelException - Failed to extract body due to: 
> Unable to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. 
> Message: com.sun.mail.imap.IMAPMessage@16e6c70e] 
> org.apache.camel.RuntimeCamelException: Failed to extract body due to: Unable 
> to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. Message: 
> com.sun.mail.imap.IMAPMessage@16e6c70e 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:275)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:103) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41) 
> ~[camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.createExchanges(MailConsumer.java:326)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:121) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:482) 
> [na:1.7.0] 
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:315) 
> [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:189)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
>  [na:1.7.0] 
> at java.lang.Thread.run(Thread.java:804) [na:1.7.0] 
> Caused by: javax.mail.MessagingException: Unable to load BODYSTRUCTURE 
> at 
> com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1261) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:597) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1395) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:247)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> ... 13 common frames omitted 
> Here is the route (very simple) : 
>   @Override 
>   public void configure() throws Exception { 
> from(getPropertiesUri()) 
> /**/.to("log:dummy"); 
>   } 
>   protected String getPropertiesUri() { 
> String prefix = Constants.MAIL.concat(provider); 
> StringBuilder uri = new StringBuilder(); 
> 
> uri.append(getContext().getProperties().get(prefix.concat(".protocol"))).a

[jira] [Commented] (CAMEL-9107) Exception thrown when reading a mail with an attached file, which name contains a semicolon

2015-10-08 Thread Thierry Frossard (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14948359#comment-14948359
 ] 

Thierry Frossard commented on CAMEL-9107:
-

Hello Claus,

Thank you for your response. I've exactly the same problem within a simple unit 
test using Sun JDK 1.7.0_75 and Sun javamail. Here is the stacktrace :
---
org.apache.camel.RuntimeCamelException: Error populating the initial mail 
message attachments
at 
org.apache.camel.component.mail.MailMessage.populateInitialAttachments(MailMessage.java:131)
 ~[camel-mail-2.15.2.jar:2.15.2]
at 
org.apache.camel.impl.DefaultMessage.createAttachments(DefaultMessage.java:216) 
~[camel-core-2.15.2.jar:2.15.2]
at 
org.apache.camel.impl.DefaultMessage.getAttachments(DefaultMessage.java:281) 
~[camel-core-2.15.2.jar:2.15.2]
at 
ch.gma.nova.eip.mailtoindexation.processors.MailReader.process(MailReader.java:45)
 ~[classes/:na]
at 
org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
 ~[camel-core-2.15.2.jar:2.15.2]
at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
 ~[camel-core-2.15.2.jar:2.15.2]
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 [camel-core-2.15.2.jar:2.15.2]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) 
[camel-core-2.15.2.jar:2.15.2]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) 
[camel-core-2.15.2.jar:2.15.2]
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 [camel-core-2.15.2.jar:2.15.2]
at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
 [camel-core-2.15.2.jar:2.15.2]
at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
 [camel-core-2.15.2.jar:2.15.2]
at 
org.apache.camel.component.mail.MailConsumer.processExchange(MailConsumer.java:359)
 [camel-mail-2.15.2.jar:2.15.2]
at 
org.apache.camel.component.mail.MailConsumer.processBatch(MailConsumer.java:220)
 [camel-mail-2.15.2.jar:2.15.2]
at 
org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:121) 
[camel-mail-2.15.2.jar:2.15.2]
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
 [camel-core-2.15.2.jar:2.15.2]
at 
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101) 
[camel-core-2.15.2.jar:2.15.2]
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
[na:1.7.0_75]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) 
[na:1.7.0_75]
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
 [na:1.7.0_75]
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 [na:1.7.0_75]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
[na:1.7.0_75]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
[na:1.7.0_75]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
Caused by: javax.mail.MessagingException: Unable to load BODYSTRUCTURE
at 
com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1306) 
~[mail-1.4.7.jar:1.4.7]
at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:639) 
~[mail-1.4.7.jar:1.4.7]
at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1395) 
~[thinclient-8.5.0.jar:na]
at 
org.apache.camel.component.mail.MailBinding.extractAttachmentsFromMail(MailBinding.java:291)
 ~[camel-mail-2.15.2.jar:2.15.2]
at 
org.apache.camel.component.mail.MailMessage.populateInitialAttachments(MailMessage.java:128)
 ~[camel-mail-2.15.2.jar:2.15.2]
... 23 common frames omitted



> Exception thrown when reading a mail with an attached file, which name 
> contains a semicolon
> ---
>
> Key: CAMEL-9107
> URL: https://issues.apache.org/jira/browse/CAMEL-9107
> Project: Camel
>  Issue Type: Bug
>  Components: camel-mail
>Affects Versions: 2.15.2
>Reporter: Thierry Frossard
>Priority: Minor
>
> Hi, 
> I posted this issue in Camel users forum but unfortunately got no response.
> I'm using Camel 2.15.2 with JDK 1.7 under Windows 7 and Eclipse 4.2.2 as 
> development tool. 
> My route reads from an IMAP server (IBM Lotus Notes). I have one big problem 
> : when th

[jira] [Commented] (CAMEL-9107) Exception thrown when reading a mail with an attached file, which name contains a semicolon

2015-09-28 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-9107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14934675#comment-14934675
 ] 

Claus Ibsen commented on CAMEL-9107:


Can you try outside IBM server, such as from a Java unit test or java 
standalone and use the SUN java mail library. From the stacktrace you use IBM 
Java Mail and those may be different and the latter have a problem. Just to 
verify if you can get the same problem with the SUN java mail or not.

> Exception thrown when reading a mail with an attached file, which name 
> contains a semicolon
> ---
>
> Key: CAMEL-9107
> URL: https://issues.apache.org/jira/browse/CAMEL-9107
> Project: Camel
>  Issue Type: Bug
>  Components: camel-mail
>Affects Versions: 2.15.2
>Reporter: Thierry Frossard
>Priority: Minor
>
> Hi, 
> I posted this issue in Camel users forum but unfortunately got no response.
> I'm using Camel 2.15.2 with JDK 1.7 under Windows 7 and Eclipse 4.2.2 as 
> development tool. 
> My route reads from an IMAP server (IBM Lotus Notes). I have one big problem 
> : when the route handles an email, which contains a PDF attached file with a 
> semicolon in his name (for exemple my;pdf.pdf), then the route always throws 
> this exception : 
> Failed to extract body due to: Unable to load BODYSTRUCTURE. 
> 4.08.15 15:10:11:313 CEST] 0172 SystemOut O [15:10:11.313] WARN  
> [Camel (Mail vers Indexation) thread #0 - imap://myimapserver.ch] 
> org.apache.camel.util.CamelLogger.log:224 : Caused by: 
> [org.apache.camel.RuntimeCamelException - Failed to extract body due to: 
> Unable to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. 
> Message: com.sun.mail.imap.IMAPMessage@16e6c70e] 
> org.apache.camel.RuntimeCamelException: Failed to extract body due to: Unable 
> to load BODYSTRUCTURE. Exchange: Exchange[MailMessage@0x862446e3]. Message: 
> com.sun.mail.imap.IMAPMessage@16e6c70e 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:275)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:103) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41) 
> ~[camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.createExchanges(MailConsumer.java:326)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:121) 
> ~[camel-mail-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
>  [camel-core-2.15.2.jar:2.15.2] 
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:482) 
> [na:1.7.0] 
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:315) 
> [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:189)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
>  [na:1.7.0] 
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:626)
>  [na:1.7.0] 
> at java.lang.Thread.run(Thread.java:804) [na:1.7.0] 
> Caused by: javax.mail.MessagingException: Unable to load BODYSTRUCTURE 
> at 
> com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1261) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:597) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1395) 
> ~[com.ibm.ws.prereq.javamail.jar:na] 
> at 
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:247)
>  ~[camel-mail-2.15.2.jar:2.15.2] 
> ... 13 common frames omitted 
> Here is the route (very simple) : 
>   @Override 
>   public void configure() throws Exception { 
> from(getPropertiesUri()) 
> /**/.to("log:dummy"); 
>   } 
>   protected String getPropertiesUri() { 
> String prefix = Constants.MAIL.concat(provider); 
> StringBuilder uri = new StringBuilder(); 
> 
> uri.append(getContext().getProperties().get(prefix.concat(".protocol"))).append("://");
>  
> 
> uri.append(getContext().getProperties().get(prefix.concat(".host"))).append("?");
>  
> 
> uri.append("usernam