From 5a6ad209837a8bcca14d4f74541d8ac3ea760341 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 13 Mar 2007 20:39:51 -0400
Subject: [PATCH] Fixed message headers encoding; improved recipient splitting; applied patch for attachment download (#1484198)

---
 program/steps/mail/get.inc |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index 995a485..521f477 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -63,19 +63,21 @@
     $mimetype = sprintf('%s/%s', $ctype_primary, $ctype_secondary);
     $filename = $part->d_parameters['filename'] ? $part->d_parameters['filename'] : $part->ctype_parameters['name'];
 
-    // send correct headers for content type and length
+    header("Expires: 0");
+    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
+    header("Cache-Control: private", false);
+    header("Content-Transfer-Encoding: binary");
+    header(sprintf('Content-Disposition: attachment; filename="%s";',
+                   $filename ? rcube_imap::decode_mime_string($filename) : "roundcube.$ctype_secondary"));
+
+    // send download headers
     if ($_GET['_download'])
       {
-      // send download headers
+      header("Cache-Control: private", false);
       header("Content-Type: application/octet-stream");
-      header(sprintf('Content-Disposition: attachment; filename="%s"',
-                     $filename ? rcube_imap::decode_mime_string($filename) : "roundcube.$ctype_secondary"));
       }
     else
-      {
       header("Content-Type: $mimetype");
-      header(sprintf('Content-Disposition: inline; filename="%s"', rcube_imap::decode_mime_string($filename)));
-      }
 
     // We need to set the following headers to make downloads work using IE in HTTPS mode.
     if (isset($_SERVER['HTTPS']))

--
Gitblit v1.9.1