Hello,
I am very new to camel and I am trying to read emails via pop3s and delete
them if they had been successfully processed.

if I try to do the this:
from("pop3s://n...@gmail.com?password=xxx" +
"&deleteProcessedMessages=true");
I get an exception stating that it is unknown parameter
"deleteProcessedMessages", plus I only want to delete message if I was able
to successfully handle it, not because I simply read it.
I am using camel 1.6.1

Here is a short version of What I have.
    private CamelContext  _camelContext = new DefaultCamelContext();
                
   RouteBuilder builder = new RouteBuilder() {
            public void configure() {

                from("pop3s://n...@pop.gmail.com:995?password=xxx" +
&consumer.delay=300000").process(new MailProcessor());
            }
        };
        _camelContext.addRoutes(builder);
        _camelContext.start();


The processor class:

public class MailProcessor implements Processor
{
    public void process(Exchange exchange) throws Exception
    { 
        MailExchange mExchange = (MailExchange)exchange;
        //mExchange.getIn().hasAttachments();
        MailMessage mMessage = mExchange.getIn();
        Message message = mMessage.getMessage();
        
        Address[] address = message.getFrom();
        String subject = message.getSubject();
        Object body = message.getContent();
         .........
     }
}
After processor process the message and only if it was successful, I need to
delete the message.
I cannot figure out how to delete the message, could somebody please help me
out?

Yuliya
-- 
View this message in context: 
http://www.nabble.com/how-to-delete-email-after-processing-it-tp24210252p24210252.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to