From b6de7a7c99d1e7b4a6b1369963f88906f55bc3e1 Mon Sep 17 00:00:00 2001 From: Gianluca Sforna Date: Sun, 21 Oct 2007 22:30:39 +0000 Subject: [PATCH] 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 f5dc347c-c33d-0410-90a0-b07cc1902cb9 --- core/email_api.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/email_api.php b/core/email_api.php index 1c4f025a6a..93352e05a5 100644 --- a/core/email_api.php +++ b/core/email_api.php @@ -18,7 +18,7 @@ # along with Mantis. If not, see . # -------------------------------------------------------- - # $Id: email_api.php,v 1.139.2.1 2007-10-13 22:35:24 giallu Exp $ + # $Id: email_api.php,v 1.139.2.2 2007-10-21 22:30:39 giallu Exp $ # -------------------------------------------------------- $t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR; @@ -929,9 +929,19 @@ function email_bug_info_to_one_user( $p_visible_bug_data, $p_message_id, $p_proj $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 '
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; }