From 0507640ce160905d155ffdcbd4f059ec423cdb66 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Wed, 30 Apr 2014 11:12:00 -0400
Subject: [PATCH] Don't replace line endings when downloading text/* attachments

---
 program/lib/Roundcube/rcube_imap.php |    2 +-
 program/steps/mail/get.inc           |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index ca5e35f..648f9df 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -2077,7 +2077,7 @@
 
         if ($o_part && $o_part->size) {
             $body = $this->conn->handlePartBody($this->folder, $uid, true,
-                $part ? $part : 'TEXT', $o_part->encoding, $print, $fp, $o_part->ctype_primary == 'text', $max_bytes);
+                $part ? $part : 'TEXT', $o_part->encoding, $print, $fp, $o_part->ctype_primary == 'text' && !$skip_charset_conv, $max_bytes);
         }
 
         if ($fp || $print) {
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index 3727577..4b664eb 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -344,7 +344,7 @@
             header("Content-Length: $size");
           }
 
-          $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true);
+          $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true, null, true);
         }
       }
 

--
Gitblit v1.9.1