Author: norman
Date: Mon Jun 28 08:54:42 2010
New Revision: 958507

URL: http://svn.apache.org/viewvc?rev=958507&view=rev
Log:
Make sure we use the "raw" message body when append the message to the mailbox, 
so it not get corrupted (JAMES-1021)

Modified:
    
james/server/trunk/spoolmanager/src/main/java/org/apache/james/MailboxManagerPoster.java

Modified: 
james/server/trunk/spoolmanager/src/main/java/org/apache/james/MailboxManagerPoster.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/spoolmanager/src/main/java/org/apache/james/MailboxManagerPoster.java?rev=958507&r1=958506&r2=958507&view=diff
==============================================================================
--- 
james/server/trunk/spoolmanager/src/main/java/org/apache/james/MailboxManagerPoster.java
 (original)
+++ 
james/server/trunk/spoolmanager/src/main/java/org/apache/james/MailboxManagerPoster.java
 Mon Jun 28 08:54:42 2010
@@ -157,13 +157,14 @@ public class MailboxManagerPoster implem
         this.logger = log;
     }
 
-       /**
-        * {...@link InputStream} which contains the headers and the Body of 
the wrapped {...@link MimeMessage}
-        *
-        */
+    /**
+     * {...@link InputStream} which contains the headers and the Body of the
+     * wrapped {...@link MimeMessage}
+     * 
+     */
     private final class MimeMessageInputStream extends InputStream {
-        private InputStream headersInputStream;
-        private InputStream bodyInputStream;
+        private final InputStream headersInputStream;
+        private final InputStream bodyInputStream;
         private int cStream = 0;
 
         boolean nextCR = false;
@@ -179,7 +180,9 @@ public class MailboxManagerPoster implem
                     headersOut.write("\r\n".getBytes());
                 }
                 headersInputStream = new 
ByteArrayInputStream(headersOut.toByteArray());
-                this.bodyInputStream = message.getInputStream();
+                
+                // use the raw InputStream because we want to have no 
conversion here and just obtain the original message body
+                this.bodyInputStream = message.getRawInputStream();
             } catch (MessagingException e) {
                 throw new IOException("Unable to read MimeMessage: " + 
e.getMessage());
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to