Results 1 to 6 of 6

Thread: Get Emails through IMap

Threaded View

  1. #1
    Join Date
    May 2012
    Posts
    4

    Question Get Emails through IMap

    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
    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();
    Exception:

    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
    Last edited by tiarebalbi; Feb 8th, 2013 at 05:13 AM. Reason: Posting Exception

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •