From 60808e86c162fa8259a9385954c566e38e730d56 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Thu, 28 Jul 2011 19:38:28 +0000 Subject: [PATCH] =?utf8?q?follow=20up=20r93397=20=E2=80=94=20missed=20msgi?= =?utf8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- includes/UserMailer.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 1009337132..15847160c9 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -121,6 +121,18 @@ class UserMailer { return implode( $endl, $string ); } + /** + * Create a value suitable for the MessageId Header + * + * @return String + */ + static function makeMsgId() { + global $wgServer; + + $msgid = uniqid( "UserMailer", true ); /* true required for cygwin */ + return "<$msgid@$wgServer>"; + } + /** * This function will perform a direct (authenticated) login to * a SMTP Server to use for mail relaying if 'wgSMTP' specifies an @@ -175,8 +187,8 @@ class UserMailer { $headers['Content-type'] = ( is_null( $contentType ) ? 'text/plain; charset=UTF-8' : $contentType ); $headers['Content-transfer-encoding'] = '8bit'; - // @todo FIXME - $headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] . '>'; + + $headers['Message-ID'] = self::makeMsgId(); $headers['X-Mailer'] = 'MediaWiki mailer'; $headers['From'] = $from->toString(); @@ -198,11 +210,6 @@ class UserMailer { } require_once( 'Mail.php' ); - $msgid = str_replace( " ", "_", microtime() ); - if ( function_exists( 'posix_getpid' ) ) { - $msgid .= '.' . posix_getpid(); - } - wfSuppressWarnings(); // Create the mail object using the Mail::factory method -- 2.20.1