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
$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();
}
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