Hi What version of Camel are you using?
And we could likely consider adding a check for this kind of exception with "No content" error message as in the stacktraces and regard the message as empty. Mind that the message is in english so we can only check for that and not for other languages. Also have you tried upgrading Camel and/or javax mail? It may work better on newer versions. On Wed, Mar 20, 2019 at 4:56 PM Shenavai, Manuel <manuel.shena...@sap.com> wrote: > > Hi camel users, > > > > we are using the camel mail component to fetch mails from a mailserver. For > some mails the polling fails due to a IOException (see below). > > > > I attached the mail that causes the problem to this mail (slightly changed). > The mail has an empty body, so one could argue the exception is correct. But > for other mails with empty body there is no exception thrown. > > > > I found this post which seems to be the same problem, but without a solution: > > http://camel.465427.n5.nabble.com/IMAP-No-content-td5725535.html > > > > Anyone else came across this problem? > > > > Thanks in advance > > Best regards, > > Manuel > > > > > > Caused by: java.io.IOException: No content > > at > javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:115) > > at > com.sun.mail.handlers.text_plain.getContent(text_plain.java:80) > > at > javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:795) > > at > javax.activation.DataHandler.getContent(DataHandler.java:542) > > at > javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:657) > > at > org.apache.camel.component.mail.MailBinding.extractHeadersFromMail(MailBinding.java:614) > > at > com.sap.esb.camel.mail.endpoint.configurator.mail.binding.CustomMailBinding.extractHeadersFromMail(CustomMailBinding.java:24) > > at > com.sap.esb.camel.security.cms.smime.SMimeMailBinding.extractHeadersFromMail(SMimeMailBinding.java:292) > > at > com.sap.esb.camel.mail.endpoint.configurator.mail.impl.trace.TraceMailBindingWithDelegation.extractHeadersFromMail(TraceMailBindingWithDelegation.java:42) > > at > org.apache.camel.component.mail.MailMessage.populateInitialHeaders(MailMessage.java:116) > > ... 27 common frames omitted > > Caused by: javax.mail.MessagingException: No content > > at > com.sun.mail.imap.IMAPBodyPart.getContentStream(IMAPBodyPart.java:206) > > at > javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:99) > > ... 36 common frames omitted > > -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2