james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [1/5] james-project git commit: MAILBOX-288 Removing all MIME4J limitations on other uses
Date Tue, 28 Feb 2017 09:40:26 GMT
Repository: james-project
Updated Branches:
  refs/heads/master 2d7b78a05 -> 8164badea


MAILBOX-288 Removing all MIME4J limitations on other uses


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/8164bade
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/8164bade
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/8164bade

Branch: refs/heads/master
Commit: 8164badead83c913900b9abbb1250cc266e90556
Parents: 3602b25
Author: benwa <btellier@linagora.com>
Authored: Mon Feb 27 15:16:34 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Tue Feb 28 16:39:07 2017 +0700

----------------------------------------------------------------------
 .../apache/james/mailbox/store/MimeDescriptorImpl.java  | 10 ++++++++--
 .../mailbox/store/streaming/PartContentBuilder.java     | 12 +++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/8164bade/mailbox/store/src/main/java/org/apache/james/mailbox/store/MimeDescriptorImpl.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MimeDescriptorImpl.java
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MimeDescriptorImpl.java
index 5f46ed7..351c5e9 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MimeDescriptorImpl.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MimeDescriptorImpl.java
@@ -45,6 +45,13 @@ import org.apache.james.mime4j.stream.RecursionMode;
 public class MimeDescriptorImpl implements MimeDescriptor {
 
     private final static Charset US_ASCII = Charset.forName("US-ASCII");
+    private static final MimeConfig MIME_ENTITY_CONFIG = MimeConfig.custom()
+        .setMaxContentLen(-1)
+        .setMaxHeaderCount(-1)
+        .setMaxHeaderLen(-1)
+        .setMaxHeaderCount(-1)
+        .setMaxLineLen(-1)
+        .build();
 
     
     /**
@@ -62,9 +69,8 @@ public class MimeDescriptorImpl implements MimeDescriptor {
     public static MimeDescriptorImpl build(InputStream stream) throws IOException, MimeException
{
         // Disable line length limit
         // See https://issues.apache.org/jira/browse/IMAP-132
-        MimeConfig config = MimeConfig.custom().setMaxLineLen(-1).setMaxHeaderLen(-1).build();
         //
-        final MimeTokenStream parser = new MimeTokenStream(config, new DefaultBodyDescriptorBuilder());
+        final MimeTokenStream parser = new MimeTokenStream(MIME_ENTITY_CONFIG, new DefaultBodyDescriptorBuilder());
         
         parser.parse(stream);
         

http://git-wip-us.apache.org/repos/asf/james-project/blob/8164bade/mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/PartContentBuilder.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/PartContentBuilder.java
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/PartContentBuilder.java
index f4df00d..1216094 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/PartContentBuilder.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/PartContentBuilder.java
@@ -40,6 +40,14 @@ import org.apache.james.mime4j.stream.RecursionMode;
 
 public class PartContentBuilder {
 
+    private static final MimeConfig MIME_ENTITY_CONFIG = MimeConfig.custom()
+        .setMaxContentLen(-1)
+        .setMaxHeaderCount(-1)
+        .setMaxHeaderLen(-1)
+        .setMaxHeaderCount(-1)
+        .setMaxLineLen(-1)
+        .build();
+
     private static final byte[] EMPTY = {};
 
     private final MimeTokenStream parser;
@@ -49,9 +57,7 @@ public class PartContentBuilder {
     private boolean topLevel = true;
 
     public PartContentBuilder() {
-        MimeConfig config = MimeConfig.custom().setMaxLineLen(-1).setMaxHeaderLen(-1).build();
-
-        parser = new MimeTokenStream(config);
+        parser = new MimeTokenStream(MIME_ENTITY_CONFIG);
     }
 
     public void markEmpty() {


---------------------------------------------------------------------
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