james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r935397 - in /james/imap/trunk/store/src/main/java/org/apache/james/imap/store: ConfigurableMimeTokenStream.java MimeDescriptorImpl.java StoreMailbox.java
Date Sun, 18 Apr 2010 19:40:47 GMT
Author: norman
Date: Sun Apr 18 19:40:47 2010
New Revision: 935397

URL: http://svn.apache.org/viewvc?rev=935397&view=rev
Log:
Allow MimeDescriptorImpl to parse messages with really big lines.. (IMAP-132)

Added:
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/ConfigurableMimeTokenStream.java
Modified:
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MimeDescriptorImpl.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java

Added: james/imap/trunk/store/src/main/java/org/apache/james/imap/store/ConfigurableMimeTokenStream.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/store/src/main/java/org/apache/james/imap/store/ConfigurableMimeTokenStream.java?rev=935397&view=auto
==============================================================================
--- james/imap/trunk/store/src/main/java/org/apache/james/imap/store/ConfigurableMimeTokenStream.java
(added)
+++ james/imap/trunk/store/src/main/java/org/apache/james/imap/store/ConfigurableMimeTokenStream.java
Sun Apr 18 19:40:47 2010
@@ -0,0 +1,29 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.imap.store;
+
+import org.apache.james.mime4j.parser.MimeEntityConfig;
+import org.apache.james.mime4j.parser.MimeTokenStream;
+
+public class ConfigurableMimeTokenStream extends MimeTokenStream {
+    
+    public ConfigurableMimeTokenStream(MimeEntityConfig config) {
+        super(config);
+    }
+}

Modified: james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MimeDescriptorImpl.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MimeDescriptorImpl.java?rev=935397&r1=935396&r2=935397&view=diff
==============================================================================
--- james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MimeDescriptorImpl.java
(original)
+++ james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MimeDescriptorImpl.java
Sun Apr 18 19:40:47 2010
@@ -35,6 +35,7 @@ import org.apache.james.imap.store.mail.
 import org.apache.james.imap.store.mail.model.PropertyBuilder;
 import org.apache.james.mime4j.MimeException;
 import org.apache.james.mime4j.descriptor.MaximalBodyDescriptor;
+import org.apache.james.mime4j.parser.MimeEntityConfig;
 import org.apache.james.mime4j.parser.MimeTokenStream;
 import org.apache.james.mime4j.parser.RecursionMode;
 
@@ -84,8 +85,13 @@ public class MimeDescriptorImpl implemen
     }
 
     public static MimeDescriptorImpl build(final InputStream stream) throws IOException,
MimeException {
-        final MimeTokenStream parser = MimeTokenStream
-                .createMaximalDescriptorStream();
+        // Disable line length limit
+        // See https://issues.apache.org/jira/browse/IMAP-132
+        MimeEntityConfig config = new MimeEntityConfig();
+        config.setMaximalBodyDescriptor(true);
+        config.setMaxLineLen(-1);
+        final ConfigurableMimeTokenStream parser = new ConfigurableMimeTokenStream(config);
+
         parser.parse(stream);
         parser.setRecursionMode(RecursionMode.M_NO_RECURSE);
         return createDescriptor(parser);

Modified: james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java?rev=935397&r1=935396&r2=935397&view=diff
==============================================================================
--- james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java (original)
+++ james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailbox.java Sun
Apr 18 19:40:47 2010
@@ -679,12 +679,4 @@ public abstract class StoreMailbox<Id> i
         return new MailboxMetaData(recent, permanentFlags, uidValidity, uidNext, messageCount,
unseenCount, firstUnseen, isWriteable());
     }
     
-    
-    private final class ConfigurableMimeTokenStream extends MimeTokenStream {
-        
-        public ConfigurableMimeTokenStream(MimeEntityConfig config) {
-            super(config);
-        }
-    }
-    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message