? Makefile
? compress.php
? files
? head.ppj
? head.ppx
? patches
? pdo
? test.js
? sites/all/modules
? sites/default/files
? sites/default/settings.php
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.206
diff -u -F^f -r1.206 bootstrap.inc
--- includes/bootstrap.inc	10 Jan 2008 22:47:17 -0000	1.206
+++ includes/bootstrap.inc	28 Mar 2008 16:28:18 -0000
@@ -274,7 +274,7 @@ function conf_init() {
   global $base_url, $base_path, $base_root;
 
   // Export the following settings.php variables to the global namespace
-  global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access;
+  global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access, $mail_line_endings;
   $conf = array();
 
   if (file_exists('./'. conf_path() .'/settings.php')) {
Index: includes/mail.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/mail.inc,v
retrieving revision 1.10
diff -u -F^f -r1.10 mail.inc
--- includes/mail.inc	15 Mar 2008 11:59:37 -0000	1.10
+++ includes/mail.inc	28 Mar 2008 16:28:18 -0000
@@ -181,13 +181,17 @@ function drupal_mail_send($message) {
     foreach ($message['headers'] as $name => $value) {
       $mimeheaders[] = $name .': '. mime_header_encode($value);
     }
+    global $mail_line_endings;
+    if (!isset($mail_line_endings)) {
+      $mail_line_endings = "\n";
+    }
     return mail(
       $message['to'],
       mime_header_encode($message['subject']),
-      // Note: e-mail uses CRLF for line-endings, but PHP's API requires LF
-      // for the message body.
-      // They will appear correctly in the actual e-mail that is sent.
-      str_replace("\r", '', $message['body']),
+      // Note: e-mail uses CRLF for line-endings in the body.  PHP's
+      // API requires LF on Unix and CRLF on Windows.  See
+      // $mail_line_endings in settings.php.
+      preg_replace('@\r?\n@', $mail_line_endings, $message['body']),
       // For headers, PHP's API requires that we use CRLF normally.
       join("\r\n", $mimeheaders)
     );
Index: sites/default/default.settings.php
===================================================================
RCS file: /cvs/drupal/drupal/sites/default/default.settings.php,v
retrieving revision 1.9
diff -u -F^f -r1.9 default.settings.php
--- sites/default/default.settings.php	21 Mar 2008 09:16:37 -0000	1.9
+++ sites/default/default.settings.php	28 Mar 2008 16:28:18 -0000
@@ -105,6 +105,23 @@
 $update_free_access = FALSE;
 
 /**
+ * Line endings for e-mail messages
+ *
+ * E-mail uses CRLF for line endings.  PHP's mail() API function is
+ * documented to require only LF endings in the message body.
+ * However, on Windows, mail() behaves differently and it is correct
+ * to give if CRLF; some MTAs (such as qmail) will refuse to accept
+ * messages from PHP on Windows if you only supply LF.
+ *
+ * This tries to set the correct line ending for your system.  If it
+ * does not work, you can override it.
+ */
+$mail_line_endings = "\n";
+if (isset($_SERVER['WINDIR']) || strpos($_SERVER['SERVER_SOFTWARE'], 'Win32') !== FALSE) {
+  $mail_line_endings = "\r\n";
+}
+
+/**
  * Base URL (optional).
  *
  * If you are experiencing issues with different site domains,
