jakartaee / jakartaee/mail-api

Custom Message-ID header is being overridden by the API generated unique ID

Open
#432 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**
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.