View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007787 | mantisbt | feature | public | 2007-02-28 05:14 | 2008-10-27 14:53 |
Reporter | Assigned To | giallu | |||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Fixed in Version | 1.1.0rc2 | ||||
Summary | 0007787: Robust threading of e-mails using MIME headers | ||||
Description | Currently theading of e-mails sent by Mantis doesn't work in all e-mail clients and will break completly if e-mail subjects are made variable (0004708). Proper threading that works in most e-mail clients and is not subject-dependent can be implemented by generating appropriate MIME headers (http://www.apps.ietf.org/rfc/rfc2076.html#sec-3.6) | ||||
Tags | No tags attached. | ||||
Attached Files | add-headers.patch (1,325 bytes)
Index: core/email_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/email_api.php,v retrieving revision 1.127 diff -u -r1.127 email_api.php --- core/email_api.php 6 Mar 2007 05:51:22 -0000 1.127 +++ core/email_api.php 23 Mar 2007 11:07:23 -0000 @@ -907,9 +907,19 @@ $t_message .= email_format_bug_message( $p_visible_bug_data ); + # build headers + $t_bug_id = $p_visible_bug_data['email_bug']; + $t_message_md5 = md5( $t_bug_id . $p_visible_bug_data['email_date_submitted'] ); + $t_mail_headers = array( 'keywords' => $p_visible_bug_data['set_category'] ); + if ( $p_message_id == 'email_notification_title_for_action_bug_submitted' ) { + $t_mail_headers[] = array('Message-ID' => "<{$t_message_md5}>" ); + } else { + $t_mail_headers[] = array('In-Reply-To' => "<{$t_message_md5}>" ); + } + # send mail # PRINT '<br />email_bug_info::Sending email to :'.$t_user_email; - $t_ok = email_store( $t_user_email, $t_subject, $t_message, array( 'keywords' => $p_visible_bug_data['set_category'] ) ); + $t_ok = email_store( $t_user_email, $t_subject, $t_message, $t_mail_headers ); return $t_ok; } @@ -1137,4 +1147,5 @@ return $t_bug_data; } -?> \ No newline at end of file +# vim: noexpandtab tabstop=4 softtabstop=0: +?> | ||||
I'd really like to push this forward, as it seems to not so hard and very useful. I investigated the issue using bugzilla as reference (where threaded emails support was added in 2.20), and their "trick" is in this few lines of code: if ($isnew) { of course, $threadingmarker is added later to the mail headers |
|
I attached a small patch to add a new header on the generated emails with the same method as bugzilla. Generated mails seems to be correctly threaded in Gmail, with the exception of when one changes the summary (though this could be different with other clients) |
|
Following are my comments on the patch:
Thanks for your contribution. Please attach an updated patch. |
|
The patch was updated to address your comments. I hope this is fine enough for inclusion |
|
The change looks good. I have a couple of questions?
Other than that, I think it is a useful and a simple change. |
|
If this is to make it into 1.1.x branch, then we better get it in before the rc2 release. |
|
In reply to your previous comment:
|
|
Committed in BRANCH_1_1_0 (will merge to HEAD later) Victor, please drop me a note when you update this Mantis instance, I'd like to see how effective it is on gmail. |
|
MantisBT: master-1.1.x b6de7a7c 2007-10-21 18:30 Details Diff |
Fix 7787: Robust threading of e-mails using MIME headers git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/branches/BRANCH_1_1_0@4657 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9 |
Affected Issues 0007787 |
|
mod - core/email_api.php | Diff File |