Bug 1837680: Add Message-ID header when missing at send#146
Open
mrenvoize wants to merge 5 commits into
Open
Conversation
Member
|
GitHub isn't very good with messaging... the force-push was rebasing this PR on top of the target branch since there's been a bunch of upstream changes since it was filed. |
justdave
requested changes
Jun 21, 2026
justdave
left a comment
Member
There was a problem hiding this comment.
The review comments from bugzilla/bugzilla#205 also apply here.
Detect whether a Message-ID header has been included in the message passed to MessageToMTA and generate one if it's missing. GMail and other modern mail services now expect a Message-ID as part of the message else they mark them as spam or drop them entirely.
Bugzilla->params->{'urlbase'} has been moved to Bugzilla->localconfig->urlbase
Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
- Strip path components from urlbase when building sitespec, as '/' is illegal after '@' in a Message-ID (affects both build_thread_marker and build_message_id) - Fix stale $2 capture variable risk by conditioning port relocation on the substitution succeeding, in both functions - Avoid falling back to Bugzilla->user->id in build_message_id, which is called from contexts with no logged-in user; random bits ensure uniqueness without a user identifier
- Remove trailing whitespace from the spam-guard comment and blank line - Omit the user_id segment entirely when absent rather than producing a double-dash (bugzilla--rand@domain), giving bugzilla-rand@domain
Test the sitespec transformation for four urlbase forms (plain, with path, with port, with port+path) to guard against regressions in the '/' stripping and port relocation logic. Also covers user_id handling in build_message_id (present, absent, no double-dash).
Contributor
Author
|
Rebased, fixes for comments applied and unit test added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detect whether a Message-ID header has been included in the message passed to MessageToMTA and generate one if it's missing.
GMail and other modern mail services now expect a Message-ID as part of the message else they mark them as spam or drop them entirely.
** This is a port of the same bug fix submitted for Bugzilla 5.2 **