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:
+?>
