Bug 1837680: Add Message-ID header when missing at send#146
Conversation
|
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
left a comment
There was a problem hiding this comment.
The review comments from bugzilla/bugzilla#205 also apply here.
|
Rebased, fixes for comments applied and unit test added. |
1f79550 to
29db591
Compare
|
I've lost track.. is there anything outstanding here? |
justdave
left a comment
There was a problem hiding this comment.
I've lost track.. is there anything outstanding here?
I just added some review comments on the 5.2 PR which probably apply here as well.
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).
Stripping the path from urlbase loses information: two independent Bugzilla installs hosted in different subdirectories of the same domain (e.g. /team-a/ and /team-b/) would produce identical sitespecs, letting mail clients that group by References/In-Reply-To/Message-ID cross-thread unrelated bugs from separate installations. Relocate the path in front of the domain instead, the same way the port number is already relocated, sanitizing any internal '/' since it's illegal in a domain. Updates build_thread_marker and build_message_id identically, plus the corresponding tests.
|
Follow-up Pushed |
justdave
left a comment
There was a problem hiding this comment.
Fixes look good. I wasn't expecting subdir and port to end up on the front side of the @ but that's legal and works for me. :-)
justdave
left a comment
There was a problem hiding this comment.
Looks good with that cleared up.
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 **