Skip to content

Commit

Permalink
Fix 10040: Email notification from new bug report submission Message-…
Browse files Browse the repository at this point in the history
…ID headers not RFC 822 compliant
  • Loading branch information
giallu committed Jan 11, 2009
1 parent e0c3906 commit d5b6cf2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/email_api.php
Expand Up @@ -833,7 +833,12 @@ function email_send( $p_email_data ) {
foreach( $t_email_data->metadata['headers'] as $t_key => $t_value ) {
switch( $t_key ) {
case 'Message-ID':
$mail->set( 'MessageID', $t_value );
/* Note: hostname can never be blank here as we set metadata['hostname']
in email_store() where mail gets queued. */
if ( !strchr( $t_value, '@' ) && !is_blank( $mail->Hostname ) ) {
$t_value = $t_value . '@' . $mail->Hostname;
}
$mail->set( 'MessageID', "<$t_value>" );
break;
case 'In-Reply-To':
$mail->AddCustomHeader( "$t_key: <{$t_value}@{$mail->Hostname}>" );
Expand Down

0 comments on commit d5b6cf2

Please sign in to comment.