You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2018/09/06 13:37:54 UTC
[tika] 02/03: Mime magic for "MIME Encapsulation of Aggregate HTML
Documents" (MHTML),
pulled out from rfc822 (may not be fully correct long-term...)
This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch branch_1x
in repository https://gitbox.apache.org/repos/asf/tika.git
commit 39f69efc642ade48c5b8021d0500e7363c8f4ac5
Author: Nick Burch <ni...@gagravarr.org>
AuthorDate: Thu Sep 6 09:28:14 2018 +0100
Mime magic for "MIME Encapsulation of Aggregate HTML Documents" (MHTML), pulled out from rfc822 (may not be fully correct long-term...)
---
.../org/apache/tika/mime/tika-mimetypes.xml | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
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 61a1634..fc34cf8 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
@@ -5796,9 +5796,28 @@
</magic>
<glob pattern="*.eml"/>
<glob pattern="*.mime"/>
+ <sub-class-of type="text/x-tika-text-based-message"/>
+ </mime-type>
+
+ <!-- TODO See TIKA-2723 for discussions on the mime type hierarchy -->
+ <!-- and best parser structure for these email-like formats -->
+ <mime-type type="multipart/related">
+ <acronym>MHTML</acronym>
+ <_comment>MIME Encapsulation of Aggregate HTML Documents</_comment>
+ <tika:link>http://tools.ietf.org/html/rfc2557</tika:link>
+ <alias type="application/x-mimearchive"/>
+ <alias type="message/rfc2557"/>
+ <!-- higher priority than message/rfc822 -->
+ <magic priority="60">
+ <match value="From: \x3cSaved by Windows Internet Explorer 8\x3e" type="stringignorecase" offset="0"/>
+ <match value="From: \x22Saved by Internet Explorer 11\x22" type="stringignorecase" offset="0"/>
+ <match value="MIME-Version: 1.0" type="string" offset="0">
+ <match value="\nContent-Type: multipart/related" type="string" offset="16:512"/>
+ </match>
+ </magic>
<glob pattern="*.mht"/>
<glob pattern="*.mhtml"/>
- <sub-class-of type="text/x-tika-text-based-message"/>
+ <sub-class-of type="message/rfc822"/>
</mime-type>
<mime-type type="message/s-http"/>
@@ -5900,7 +5919,6 @@
<mime-type type="multipart/header-set"/>
<mime-type type="multipart/mixed"/>
<mime-type type="multipart/parallel"/>
- <mime-type type="multipart/related"/>
<mime-type type="multipart/report"/>
<mime-type type="multipart/signed"/>
<mime-type type="multipart/voice-message"/>