I am reading all mails from my inbox using Apache camel, with endpoint option
peek=false.
And process its attachments, according to our business logic. If my business
logic fails, then i need to make the mail to be "marked as unread", if the
processing is success, then "mark as read".


            CamelContext context = new DefaultCamelContext();

            Endpoint endpoint =
                    context.getEndpoint("imaps://imap.gmail.com?username="
                            + mailId
                            + "&password="
                            + password
                            +
"&delete=false&peek=false&unseen=true&consumer.delay=60000&closeFolder=false&disconnect=false");

            pollingConsumer = endpoint.createPollingConsumer();
            pollingConsumer.start();

            pollingConsumer.getEndpoint().createExchange();

            Exchange exchange = pollingConsumer.receive(6000);

            while (exchange != null) {
                process(exchange);
                exchange = pollingConsumer.receive(6000);
            }

        



--
View this message in context: 
http://camel.465427.n5.nabble.com/Mail-marking-as-read-and-unread-tp5756669.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to