Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix 7787: Robust threading of e-mails using MIME headers
  • Loading branch information
giallu committed Oct 21, 2007
1 parent 3202137 commit b6de7a7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions core/email_api.php
Expand Up @@ -18,7 +18,7 @@
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.

# --------------------------------------------------------
# $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;
Expand Down Expand Up @@ -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 '<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;
}
Expand Down

0 comments on commit b6de7a7

Please sign in to comment.