Navigation Menu

Skip to content

Commit

Permalink
Fix 8706: Bad email headers for notifications
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4974 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
giallu committed Feb 8, 2008
1 parent f36e6f0 commit 29ec103
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions core/email_api.php
Expand Up @@ -497,6 +497,7 @@ function email_generic( $p_bug_id, $p_notify_type, $p_message_id = null, $p_head

# send email to every recipient
foreach ( $t_recipients as $t_user_id => $t_user_email ) {
echo "email sent to $t_user_email<br/>";
# load (push) user language here as build_visible_bug_data assumes current language
lang_push( user_pref_get_language( $t_user_id, $t_project_id ) );

Expand Down Expand Up @@ -794,7 +795,18 @@ function email_send( $p_email_data ) {

if ( isset( $t_email_data->metadata['headers'] ) && is_array( $t_email_data->metadata['headers'] ) ) {
foreach ( $t_email_data->metadata['headers'] as $t_key => $t_value ) {
$mail->AddCustomHeader( "$t_key: $t_value" );
switch ( $t_key ) {
case 'Message-ID':
// Overwrite default Message ID
$mail->set( 'MessageID', $t_value );
break;
case 'In-Reply-To':
$mail->AddCustomHeader( "$t_key: <{$t_value}@{$mail->Hostname}>" );
break;
default:
$mail->AddCustomHeader( "$t_key: $t_value" );
break;
}
}
}

Expand Down Expand Up @@ -952,9 +964,9 @@ function email_bug_info_to_one_user( $p_visible_bug_data, $p_message_id, $p_proj
$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['Message-ID'] = "<{$t_message_md5}>";
$t_mail_headers['Message-ID'] = $t_message_md5;
} else {
$t_mail_headers['In-Reply-To'] = "<{$t_message_md5}>";
$t_mail_headers['In-Reply-To'] = $t_message_md5;
}

# send mail
Expand Down

0 comments on commit 29ec103

Please sign in to comment.