Skip to content

"NO EXAMINE Unsafe Login" When folder reopen #750

@ANoviceOfJava

Description

@ANoviceOfJava

Describe the bug
When I connect to mailbox 163, due to server restrictions, I need to call store.id() and folder.id(), which can get messages normally. However, when I close folder and call store.isConnected(), folder.open() will throw an exception: "B4 NO EXAMINE Unsafe Login. Please contact [email protected] for help", which means that the folder.id() I set earlier does not work, but I have no way to reset it.

To Reproduce
Steps to reproduce the behavior:

  1. Create store and call store.id
  2. Create folder and call folder.id
  3. Call folder.isConnected()
  4. Call folder.close()
  5. Call folder.open(),throw exception

Expected behavior
After the folder is closed, it can be opened normally

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows
  • Version 2.0.1

Mail server:

  • Protocol being used: imaps
  • Vendor/product: 163
  • Mail service URL: mail 163.com

Additional context

Session session = Session.getInstance(props);
Store store = session.getStore("imaps");
store.connect(emailServiceType.getImap(), username, password);
IMAPStore imapStore = (IMAPStore) store;
Map<String, String> iam = new HashMap<>();
iam.put("name","111");
iam.put("version","1.0.0");
iam.put("vendor","111");
iam.put("support-email","[email protected]");
imapStore.id(iam);
// folder
IMAPFolder folder = (IMAPFolder) store.getFolder(folderName);
folder.open(Folder.READ_ONLY);
synchronized (folder) {
    folder.id(iam);
}
store.isConnected();
if (folder.isOpen()) {
    folder.close(false);
}
if (!folder.isOpen()) {
    folder.open(Folder.READ_ONLY);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions