[ 
https://issues.apache.org/jira/browse/TIKA-879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14257888#comment-14257888
 ] 

Nick Burch commented on TIKA-879:
---------------------------------

I've done something a little different in r1647721 as a partial workaround - 
I've added a new mimetype of text/x-tika-text-based-message which is a parent 
of the 3 text-based message/ mimetypes (most of the message/ mimetypes are not 
text based). With that in place, Vladimir's test email is now correctly 
detected when it has a .eml extension. (I think that this parent probably is 
more semantically meaningful than text/plain, which is why I went for it)

However, this doesn't solve the "detection without filename" issue, and some 
other related mail detection problems (eg multipart/signed). We might therefore 
want to think about adding a new mail detector, along the lines of the one 
suggested in this Stack Overflow question from a few weeks back - 
http://stackoverflow.com/questions/27397807/tika-detect-multipart-signed

> Detection problem: message/rfc822 file is detected as text/plain.
> -----------------------------------------------------------------
>
>                 Key: TIKA-879
>                 URL: https://issues.apache.org/jira/browse/TIKA-879
>             Project: Tika
>          Issue Type: Bug
>          Components: metadata, mime
>    Affects Versions: 1.0, 1.1, 1.2
>         Environment: linux 3.2.9
> oracle jdk7, openjdk7, sun jdk6
>            Reporter: Konstantin Gribov
>            Assignee: Nick Burch
>         Attachments: TIKA-879-thunderbird.eml
>
>
> When using {{DefaultDetector}} mime type for {{.eml}} files is different (you 
> can test it on {{testRFC822}} and {{testRFC822_base64}} in 
> {{tika-parsers/src/test/resources/test-documents/}}).
> Main reason for such behavior is that only magic detector is really works for 
> such files. Even if you set {{CONTENT_TYPE}} in metadata or some {{.eml}} 
> file name in {{RESOURCE_NAME_KEY}}.
> As I found {{MediaTypeRegistry.isSpecializationOf("message/rfc822", 
> "text/plain")}} returns {{false}}, so detection by {{MimeTypes.detect(...)}} 
> works only by magic.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to