jakartaee / jakartaee/mail-api

"NO EXAMINE Unsafe Login" When folder reopen

Open
#750 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
285
Forks
109
Avg merge
15h 19m
Merged PRs (30d)
1

Description

**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 kefu@188.com 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](https://github.com/user-attachments/assets/329701b1-b07c-43cf-abda-f47ca78966c6)

**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**
``` java
Session session = Session.getInstance(props);
Store store = session.getStore("imaps");
store.connect(emailServiceType.getImap(), username, password);
IMAPStore imapStore = (IMAPStore) store;
Map iam = new HashMap<>();
iam.put("name","111");
iam.put("version","1.0.0");
iam.put("vendor","111");
iam.put("support-email","111@111.com");
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);
}
```

Contributor guide

Open the contributing guide

Research direction

Use the IMAPStore.id, IMAPFolder.id, Folder.open, and Folder.close calls in the reproduction as entry points, and first investigate how the IMAP server identity state is retained across folder close and reopen. Done means reproducing the 163 IMAP failure and allowing the folder to reopen normally after it has been closed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.