Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -122,6 +122,18 @@ |
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
| 126 | + * Create a value suitable for the MessageId Header |
| 127 | + * |
| 128 | + * @return String |
| 129 | + */ |
| 130 | + static function makeMsgId() { |
| 131 | + global $wgServer; |
| 132 | + |
| 133 | + $msgid = uniqid( "UserMailer", true ); /* true required for cygwin */ |
| 134 | + return "<$msgid@$wgServer>"; |
| 135 | + } |
| 136 | + |
| 137 | + /** |
126 | 138 | * This function will perform a direct (authenticated) login to |
127 | 139 | * a SMTP Server to use for mail relaying if 'wgSMTP' specifies an |
128 | 140 | * array of parameters. It requires PEAR:Mail to do that. |
— | — | @@ -175,8 +187,8 @@ |
176 | 188 | $headers['Content-type'] = ( is_null( $contentType ) ? |
177 | 189 | 'text/plain; charset=UTF-8' : $contentType ); |
178 | 190 | $headers['Content-transfer-encoding'] = '8bit'; |
179 | | - // @todo FIXME |
180 | | - $headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] . '>'; |
| 191 | + |
| 192 | + $headers['Message-ID'] = self::makeMsgId(); |
181 | 193 | $headers['X-Mailer'] = 'MediaWiki mailer'; |
182 | 194 | $headers['From'] = $from->toString(); |
183 | 195 | |
— | — | @@ -198,11 +210,6 @@ |
199 | 211 | } |
200 | 212 | require_once( 'Mail.php' ); |
201 | 213 | |
202 | | - $msgid = str_replace( " ", "_", microtime() ); |
203 | | - if ( function_exists( 'posix_getpid' ) ) { |
204 | | - $msgid .= '.' . posix_getpid(); |
205 | | - } |
206 | | - |
207 | 214 | wfSuppressWarnings(); |
208 | 215 | |
209 | 216 | // Create the mail object using the Mail::factory method |