james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [2/5] james-project git commit: MAILBOX-288 Remove all MIME4J limits when parsing ES indexableMessage
Date Tue, 28 Feb 2017 09:40:27 GMT
MAILBOX-288 Remove all MIME4J limits when parsing ES indexableMessage


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

Branch: refs/heads/master
Commit: 746f2a58db757c25ab83de825984a15455af373f
Parents: 490c628
Author: benwa <btellier@linagora.com>
Authored: Mon Feb 27 15:11:53 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Tue Feb 28 16:39:07 2017 +0700

----------------------------------------------------------------------
 .../james/mailbox/elasticsearch/json/MimePartParser.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/746f2a58/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartParser.java
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartParser.java
b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartParser.java
index be22627..48d8053 100644
--- a/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartParser.java
+++ b/mailbox/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartParser.java
@@ -36,6 +36,14 @@ import com.google.common.base.Preconditions;
 
 public class MimePartParser {
 
+    private static final MimeConfig MIME_ENTITY_CONFIG = MimeConfig.custom()
+        .setMaxContentLen(-1)
+        .setMaxHeaderCount(-1)
+        .setMaxHeaderLen(-1)
+        .setMaxHeaderCount(-1)
+        .setMaxLineLen(-1)
+        .build();
+
     private final Message message;
     private final TextExtractor textExtractor;
     private final MimeTokenStream stream;
@@ -49,7 +57,7 @@ public class MimePartParser {
         this.builderStack = new LinkedList<>();
         this.currentlyBuildMimePart = new RootMimePartContainerBuilder();
         this.stream = new MimeTokenStream(
-            MimeConfig.custom().setMaxLineLen(-1).setMaxHeaderLen(-1).build(),
+            MIME_ENTITY_CONFIG,
             new DefaultBodyDescriptorBuilder());
     }
 


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