Good Afternoon,
I'm needing to connect to a imap account to get all incoming messages, but when I try to use the ImapReceiver I can check the total messages in the account, but not get the messages.
Following example used.
1th
Exception:Code:ImapMailReceiver receiver = new ImapMailReceiver("imaps://xxxx:yyyy@imap.gmail.com:993/INBOX");
receiver.setShouldMarkMessagesAsRead(true);
receiver.setShouldDeleteMessages(true);
// When i call this method throw new exception "NullPointerException"
Message[] a = receiver.receive();
Code:
Exception in thread "main" javax.mail.MessagingException: A7 NO STORE attempt on READ-ONLY folder (Failure);
nested exception is:
com.sun.mail.iap.CommandFailedException: A7 NO STORE attempt on READ-ONLY folder (Failure)
at com.sun.mail.imap.IMAPMessage.setFlags(IMAPMessage.java:905)
at javax.mail.Message.setFlag(Message.java:578)
at org.springframework.integration.mail.AbstractMailReceiver.setMessageFlags(AbstractMailReceiver.java:299)
at org.springframework.integration.mail.AbstractMailReceiver.postProcessFilteredMessages(AbstractMailReceiver.java:265)
at org.springframework.integration.mail.AbstractMailReceiver.receive(AbstractMailReceiver.java:254)
at org.springframework.integration.samples.mail.imapidle.GmailInboundImapIdleAdapterTestApp.main(GmailInboundImapIdleAdapterTestApp.java:41)
Caused by: com.sun.mail.iap.CommandFailedException: A7 NO STORE attempt on READ-ONLY folder (Failure)
at com.sun.mail.iap.Protocol.handleResult(Protocol.java:351)
at com.sun.mail.imap.protocol.IMAPProtocol.storeFlags(IMAPProtocol.java:1589)
at com.sun.mail.imap.protocol.IMAPProtocol.storeFlags(IMAPProtocol.java:1574)
at com.sun.mail.imap.IMAPMessage.setFlags(IMAPMessage.java:901)
... 5 more

