Hi Claus Thanks for that quick help.
I have modified my route file as follows and passed the Exchange into a processor class where I process the contents. * <route> <from uri="imaps://imap.gmail.com?username=mygmai...@gmail.com&password=password&delete=false&unseen=true&consumer.delay=60000&mapMailMessage=true&delete=true"/> <to uri="bean:processEmail" /> </route>* Yet am getting following error. It looks more like issues with extracting body from email. 2014-03-18 21:04:05,883 [ing.Main.main()] INFO SpringCamelContext - Total 1 routes, of which 1 is started. 2014-03-18 21:04:05,886 [ing.Main.main()] INFO SpringCamelContext - Apache Camel 2.10.0.fuse-71-047 (CamelContext: camel-1) started in 0.820 seconds 2014-03-18 21:04:16,421 [/imap.gmail.com] WARN MailConsumer - Caused by: [org.apache.camel.RuntimeCamelException - Failed to extract body due to: null. Exchange: Exchange[MailMessage: messageNumber=[1], from=[Frenchi Elizabeth <bethf...@gmail.com>], to=[reji.c...@gmail.com], subject=[test], sentDate=[18 Mar, 2014 8:55:42 PM], receivedDate=[18 Mar, 2014 8:55:43 PM]]. Message: com.sun.mail.imap.IMAPMessage@151c590] org.apache.camel.RuntimeCamelException: Failed to extract body due to: null. Exchange: Exchange[MailMessage: messageNumber=[1], from=[Frenchi Elizabeth <bethf...@gmail.com>], to=[reji.c...@gmail.com], subject=[test], sentDate=[18 Mar, 2014 8:55:42 PM], receivedDate=[18 Mar, 2014 8:55:43 PM]]. Message: com.sun.mail.imap.IMAPMessage@151c590 at org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:269) at org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:96) at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41) at org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:135) at org.apache.camel.component.mail.MailMessage.copyFrom(MailMessage.java:130) at org.apache.camel.impl.MessageSupport.copy(MessageSupport.java:124) at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:56) at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:33) at org.apache.camel.impl.DefaultUnitOfWork.<init>(DefaultUnitOfWork.java:91) at org.apache.camel.impl.DefaultUnitOfWork.<init>(DefaultUnitOfWork.java:71) at org.apache.camel.processor.UnitOfWorkProcessor.createUnitOfWork(UnitOfWorkProcessor.java:190) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.mail.MailConsumer.processExchange(MailConsumer.java:238) at org.apache.camel.component.mail.MailConsumer.processBatch(MailConsumer.java:189) at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:115) at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException at javax.mail.internet.ParameterList.set(ParameterList.java:165) at com.sun.mail.imap.protocol.BODYSTRUCTURE.parseParameters(BODYSTRUCTURE.java:404) at com.sun.mail.imap.protocol.BODYSTRUCTURE.<init>(BODYSTRUCTURE.java:224) at com.sun.mail.imap.protocol.BODYSTRUCTURE.<init>(BODYSTRUCTURE.java:109) at com.sun.mail.imap.protocol.FetchResponse.parse(FetchResponse.java:158) at com.sun.mail.imap.protocol.FetchResponse.<init>(FetchResponse.java:67) at com.sun.mail.imap.protocol.IMAPResponse.readResponse(IMAPResponse.java:136) at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:270) at com.sun.mail.iap.Protocol.command(Protocol.java:313) at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1529) at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1521) at com.sun.mail.imap.protocol.IMAPProtocol.fetchBodyStructure(IMAPProtocol.java:1221) at com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1307) at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:623) at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:927) at org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:241) ... 31 more -- View this message in context: http://camel.465427.n5.nabble.com/Polling-Email-Component-Runtime-Error-tp5749047p5749050.html Sent from the Camel - Users mailing list archive at Nabble.com.