This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/master by this push:
     new 0903104  TIKA-2594 -- improve eml detection for those starting with 
Subject: and containing html
0903104 is described below

commit 09031046e5bece75ed22d9ee9b184ec49a14f99a
Author: tballison <talli...@mitre.org>
AuthorDate: Wed Mar 7 13:14:20 2018 -0500

    TIKA-2594 -- improve eml detection for those starting with Subject: and
    containing html
---
 .../org/apache/tika/mime/tika-mimetypes.xml        |   1 +
 .../java/org/apache/tika/mime/TestMimeTypes.java   |   3 +
 .../testEML_embedded_xhtml_and_img.eml             | 141 +++++++++++++++++++++
 3 files changed, 145 insertions(+)

diff --git 
a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml 
b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
index e8da795..8855922 100644
--- a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
+++ b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
@@ -5693,6 +5693,7 @@
       <match value="From:" type="stringignorecase" offset="0"/>
       <match value="Received:" type="stringignorecase" offset="0"/>
       <match value="Message-ID:" type="stringignorecase" offset="0"/>
+      <match value="\nMessage-ID:" type="stringignorecase" offset="0:8192"/>
       <match value="Date:" type="string" offset="0"/>
       <match value="User-Agent:" type="string" offset="0"/>
       <match value="MIME-Version:" type="stringignorecase" offset="0"/>
diff --git a/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java 
b/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java
index 835a525..65acbc3 100644
--- a/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java
+++ b/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java
@@ -909,6 +909,9 @@ public class TestMimeTypes {
         //x- custom header
         assertTypeDetection("testRFC822_x-.eml", "message/rfc822");
 
+        //embedded xhtml and img
+        assertTypeDetection("testEML_embedded_xhtml_and_img.eml", 
"message/rfc822");
+
     }
     
     @Test
diff --git 
a/tika-parsers/src/test/resources/test-documents/testEML_embedded_xhtml_and_img.eml
 
b/tika-parsers/src/test/resources/test-documents/testEML_embedded_xhtml_and_img.eml
new file mode 100644
index 0000000..822cb8b
--- /dev/null
+++ 
b/tika-parsers/src/test/resources/test-documents/testEML_embedded_xhtml_and_img.eml
@@ -0,0 +1,141 @@
+Subject: This is the subject
+From: "Sender" <sen...@test.com>
+To: <recei...@test.com>
+Date: Wed, 21 Mar 2018 14:14:32 -0800
+List-Unsubscribe: <mailto:unsubscr...@test.com>
+Content-Type: multipart/related; boundary="f4ff6b19348ff123_b9347c3a6d123456a"
+MIME-Version: 1.0
+Message-ID: <0123456...@test.com>
+
+--f4ff6b19348ff123_b9347c3a6d123456a
+Content-Type: multipart/alternative; 
boundary="f4ff6b19348ff123_b9347c3a6d123456b"
+
+--f4ff6b19348ff123_b9347c3a6d123456b
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8-bit
+Content-Disposition: inline
+
+This is a test
+
+Using inline content
+
+Unsubscribe:
+http://test.com/receiver/asgdnjlsakgHjghskusegnkKLghslkagjasduiLKGlkjsgslkjgeseklgj
+
+--f4ff6b19348ff123_b9347c3a6d123456b
+Content-Type: text/html; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: inline
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <title>XHTML test document</title>
+    <meta name="Author" content="Tika Developers"/>
+    <meta http-equiv="refresh" content="5"/>
+  </head>
+  <body>
+    <p>
+      This document tests the ability of Apache Tika to extract content
+      from an <a href="http://www.w3.org/TR/xhtml1/";>XHTML document</a>.
+    </p>
+  </body>
+</html>
+
+--f4ff6b19348ff123_b9347c3a6d123456b--
+
+
+
+
+
+--f4ff6b19348ff123_b9347c3a6d123456a
+Content-Type: image/jpeg; name="testimage.jpeg"
+Content-Description:testimage.jpeg
+Content-Disposition: inline; filename="testimage.jpeg";
+Content-Transfer-Encoding: base64
+
+/9j/4AAQSkZJRgABAQEASABIAAD//gATQ3JlYXRlZCB3aXRoIEdJTVD/2wBDAAMCAgMCAgMDAwME
+AwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBD
+AQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU
+FBQUFBQUFBT/wgARCACAAIADAREAAhEBAxEB/8QAHAABAAICAwEAAAAAAAAAAAAAAAcIBQYDBAkB
+/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEAMQAAABtSAAAAAa+U1JFLSgAAAGKNKJKBVo
+qgcp6ngAAAHn2ReXPLCmnlOyaixQBjyFSYDNAFECGi8pN4KymKLVHKCoBWomovUAcRhDYAa0eaAP
+QQlAEAFLy1RaUAAAFOzElzztgAAAAAAAAAio103U6ZqZtx1TZDiMAZQ2kzIANaIfMUZM+GXNkIqO
+IyZ0yViSjiK3m9ktAAAA6pohIoBBRSA7Z6kgAAAAAGqlFSRS54ABEpohZAGENgAAAAAPLY6hd8gU
+hovKTeAAVaKoG9nocdspgR0XqKSkXlzywoABRUhU5T01M0ADFGlElAAAwpDRupJQAAAAP//EACIQ
+AAICAgIDAAMBAAAAAAAAAAQFAwYCBwAQASAwFBUXQP/aAAgBAQABBQL5vXoldXM9uPzCqJtUg0/4
+s2oiYUXZFbMn63lLn4i5FFnPL8djPiHVo5pt8QyUctVZHtagrU9kHnoOr/0s/Z546sOXc6KOVQ6C
+fB97OqpCR9zVVVIryjq1bi8AmId0y5mRS4TxdbtZz5NOajZzh2/uWLCeIWvKwZ+rNLnBW+tZS5zU
+fralKnfwSxZwS6qohQRnwtWoDYDEOoG5hgg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ixoKofKxenHvIIhpDVGTAfqzXCyoAAVUDHDqWHtQpUUGShz41kgkv+tmFNSDm8sSZRcxqUjE
+iCfIIRlMfAEYJUqBzon5GnABbCdXrkf/2Q==
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
talli...@apache.org.

Reply via email to