Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8514011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:44:38+00:00 2026-06-11T04:44:38+00:00

Upon calling the following I code snipit: Message message_in = null; inbox instanceof IMAPFolder

  • 0

Upon calling the following I code snipit:

Message message_in  = null;
inbox instanceof IMAPFolder
IMAPFolder f = (IMAPFolder)inbox;
f.idle();
System.out.println("IDLE done");                                              
message_in = inbox.getMessage(inbox.getMessageCount());
message_in.setFlag(Flags.Flag.DELETED, true);
inbox.expunge();

I receive the error message:

javax.mail.MessagingException: A9 NO Command received in Invalid state.;
  nested exception is:
    com.sun.mail.iap.CommandFailedException: A9 NO Command received in Invalid state.
    at com.sun.mail.imap.IMAPMessage.setFlags(IMAPMessage.java:905)
    at javax.mail.Message.setFlag(Message.java:578)
    at com.name.vmmonitor.main.VMMonitor.startPolling(VMMonitor.java:160)
    at com.name.vmmonitor.main.VMMonitor.main(VMMonitor.java:283)
Caused by: com.sun.mail.iap.CommandFailedException: A9 NO Command received in Invalid state.
    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)
    ... 3 more

What is the issue? I am able to call methods such as message_in.getSubject() but why not message_in.setFlag()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:44:39+00:00Added an answer on June 11, 2026 at 4:44 am

    The “A9 NO Command received in Invalid state.” means the IMAP folder (the account) is read-only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Upon calling the following I code snipit: Message message_in = null; inbox instanceof IMAPFolder
I am following this example . I keep getting this error whenever calling upon
In a few examples of code I have seen the following when calling a
I've got the following code in one of my view controllers: - (void)tableView:(UITableView *)tableView
I have stumbled upon a problem when calling a nested Async which happens to
I'm having a devil of a time understanding references. Consider the following code: class
Is it possible that upon calling a constructor also the object be initialized to
In our code we do the following: - (void) createComment:(NSString *)comment ForId:(NSString *)objectId {
Upon user login I check their roles. If they have no roles I want
Upon visiting an older site it can be common to find deprecated tags and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.