From 2ae68f97446ff6bae5fbbe463eb00312598be840 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sat, 26 Jun 2010 18:27:16 +0200
Subject: [PATCH] use CRLF in quoted printable encoding FS#1755

Needs testing from:

a) Exchange users - is FS1755 fixed for you?
b) everone else - all okay still?
---
 inc/mail.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/inc/mail.php b/inc/mail.php
index 6d1652fc0..38232d110 100644
--- a/inc/mail.php
+++ b/inc/mail.php
@@ -11,6 +11,7 @@ if(!defined('DOKU_INC')) die('meh.');
 // end of line for mail lines - RFC822 says CRLF but postfix (and other MTAs?)
 // think different
 if(!defined('MAILHEADER_EOL')) define('MAILHEADER_EOL',"\n");
+if(!defined('QUOTEDPRINTABLE_EOL')) define('QUOTEDPRINTABLE_EOL',"\015\012");
 #define('MAILHEADER_ASCIIONLY',1);
 
 /**
@@ -254,11 +255,11 @@ function mail_quotedprintable_encode($sText,$maxlen=74,$bEmulate_imap_8bit=true)
         // but this wouldn't be caught by such an easy RegExp
         if($maxlen){
             preg_match_all( '/.{1,'.($maxlen - 2).'}([^=]{0,2})?/', $sLine, $aMatch );
-            $sLine = implode( '=' . MAILHEADER_EOL, $aMatch[0] ); // add soft crlf's
+            $sLine = implode( '=' . QUOTEDPRINTABLE_EOL, $aMatch[0] ); // add soft crlf's
         }
     }
 
     // join lines into text
-    return implode(MAILHEADER_EOL,$aLines);
+    return implode(QUOTEDPRINTABLE_EOL,$aLines);
 }
 
-- 
GitLab