jakartaee / jakartaee/mail-api
setPeek(true) is not honored when getting an inner imap message part
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 285
- Forks
- 109
- Avg merge
- 15h 19m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
While setPeek(true) works fine on an IMAPMessage when getting content data such as text parts or attachment parts, when trying to get the content of an inner message part (an attached eml) the message changes to the seen state.
This has been verified to happen both on a Cyrus and Dovecot imap server.
**To Reproduce**
Steps to reproduce the behavior:
1. get an unseen IMAPMessage instance from an IMAPFolder as m.
2. m.setPeek(true)
3. get the eml attachment part from the message as p.
4. (Message)p.getContent() and use it
**Expected behavior**
The original message should be still in the unseen state
**Mail server:**
- Protocol being used: imap
- Vendor/product: Cyrus/Dovecot
**Additional context**
We're using jakarta-mail 2.0.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing IMAPMessage.setPeek(true) through retrieval of the inner message part at p.getContent(), reproducing the case with an unseen message and an attached eml on Cyrus or Dovecot. Done means the original message remains unseen after the inner message content is read, while existing text and attachment behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100