mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #515] Option to preserve original Message-ID when releasing messages #332
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#332
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gache001 on GitHub (Jun 6, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/515
Hello,
We are integrating Mailpit into our testing environments where messages are captured before being relayed to end users.
Our backend system (Mailman) generates a unique Message-ID and stores it in OpenSearch for tracking. When users reply to those emails, Mailman uses the In-Reply-To header to associate replies with the original sent message via its Message-ID.
Currently, when releasing a message via Mailpit’s UI/API, a new Message-ID is assigned. This breaks our threading because the In-Reply-To header no longer points to any known Message-ID in our system.
We understand this behavior is by design for testing Gmail, etc., but we’d like to request a configuration option to preserve the original Message-ID when relaying/releasing.
Why this matters:
We want to avoid reverting to Mailhog, which is no longer maintained.
Accurate threading is critical to our QA and automated testing processes.
Mailpit is actively maintained and this would make it a robust fit for systems that depend on Message-ID continuity.
Kindly advise, and thanks for your awesome work on Mailpit!
@axllent commented on GitHub (Jun 6, 2025):
Hi @gache001 . That makes sense, and it is definitely an option I can add. Your timing is a bit unfortunate as I just released a new version of Mailpit a few hours ago, so this will need to wait about a week until the next release (I try not to release too often unless there is a serious bug). I will keep you posted.
@axllent commented on GitHub (Jun 6, 2025):
I have just added this feature, although as I explained earlier it will only be included in the next release which is likely a week away. If you are keen to use or test this in the meantime however, and use Docker, then you can use the latest
axllent/mailpit:edgeDocker image. The option must be set via either the relay yaml config file withpreserve-message-ids: true, or the environment variableMP_SMTP_RELAY_PRESERVE_MESSAGE_IDS=true, depending how you are configuring your relay.@gache001 commented on GitHub (Jun 7, 2025):
Awesome, thanks so much for this quick addition!
@axllent commented on GitHub (Jun 7, 2025):
You're welcome. If you are in a position to test using the Docker edge build, then I would appreciate confirmation that it works as expected, thanks.
@gache001 commented on GitHub (Jun 9, 2025):
Hi,
Message-IDs are being preserved now with edge. Thanks so much!
Will go ahead and close this issue.
@axllent commented on GitHub (Jun 9, 2025):
Great, thanks for testing. You can switch back to stable / :latest releases once the new version comes out this weekend.
@axllent commented on GitHub (Jun 14, 2025):
This feature has now been released in v1.26.1 and the documentation updated.