From 090c49d4a3343d346677ed1687ae28697f5b1c6e Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Sat, 22 Dec 2012 10:39:47 -0500
Subject: [PATCH] Treat image/pjpeg as image/jpeg

---
 program/steps/mail/func.inc |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index f516539..7049376 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1290,7 +1290,7 @@
 
   // Content-Type: image/*...
   if (preg_match($mime_regex, $part->mimetype)) {
-    return $part->mimetype;
+    return rcmail_fix_mimetype($part->mimetype);
   }
 
   // Many clients use application/octet-stream, we'll detect mimetype
@@ -1900,6 +1900,10 @@
   if (preg_match('/^application\/pdf.+/', $name))
     $name = 'application/pdf';
 
+  // treat image/pjpeg as image/jpeg
+  else if (preg_match('/^image\/p?jpe?g$/', $name))
+    $name = 'image/jpeg';
+
   return $name;
 }
 

--
Gitblit v1.9.1