jakartaee / jakartaee/mail-api
Custom Message-ID header is being overridden by the API generated unique ID
- Dominant language
- Java
- Stars
- 285
- Forks
- 109
- Avg merge
- 15h 19m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
Custom Message-ID header is being overridden by the API
**To Reproduce**
Steps to reproduce the behavior:
Set message-id header \<4c092797479f6fb05576e723a6855a7e116ed027@localhost.com\> and send out the mail
**Expected behavior**
The message header should be message-id: \<4c092797479f6fb05576e723a6855a7e116ed027@localhost.com\>
**Additional context**
Seems, message-id being set to generated unique-id irrespective of headers set by API user.
https://github.com/eclipse-ee4j/mail/blob/4c092797479f6fb05576e723a6855a7e116ed027/mail/src/main/java/javax/mail/internet/MimeMessage.java#L2210
generated message id should be used only when
if (getHeader("Message-ID") == null)
Could not verify the above fix due to https://github.com/eclipse-ee4j/mail/issues/431
Contributor guide
Research direction
Start in mail/src/main/java/javax/mail/internet/MimeMessage.java at the referenced line around 2210, and inspect how the Message-ID header is handled when sending a message. Preserve the user-supplied header and generate a unique ID only when it is absent; verify the behavior against the reproduction, noting that issue #431 currently blocks verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100