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

Vamsi Molli edited comment on TIKA-3445 at 6/15/21, 4:45 AM:
-------------------------------------------------------------

Because at starting of the file does not contain any headers like From, To, Cc, 
etc and also the extension of this file is txt. So when we load this file 
(mapiMessage = MapiMessage.load(paths, getAsposeEmailLoadOptions()). We are 
getting errors (The MailMessage is corrupted). Instead of throwing an error can 
we add some logic or rules in tika that if text starting doesn't contain any 
headers treat it as text/plain?


was (Author: vamsi452):
Because at starting of the file does not contain any headers like From, To, Cc, 
etc. So when we load this file (mapiMessage = MapiMessage.load(paths, 
getAsposeEmailLoadOptions()). We are getting errors (The MailMessage is 
corrupted). Instead of throwing an error can we add some logic or rules in tika 
that if text starting doesn't contain any headers treat it as text/plain?

> Extension reading it as eml instead of txt when headers are not present
> -----------------------------------------------------------------------
>
>                 Key: TIKA-3445
>                 URL: https://issues.apache.org/jira/browse/TIKA-3445
>             Project: Tika
>          Issue Type: Bug
>          Components: core, detector, metadata, mime, parser
>    Affects Versions: 1.25, 1.26
>            Reporter: Vamsi Molli
>            Priority: Blocker
>             Fix For: 1.24.1
>
>         Attachments: test_sample_message (1).txt
>
>
> The attached txt file doesn't have starting headers it is treating as .eml 
> file but it should be .txt.
> stream = TikaInputStream.get(fis = new FileInputStream(paths));stream = 
> TikaInputStream.get(fis = new FileInputStream(paths)); 
> metadata.add(Metadata.RESOURCE_NAME_KEY, paths); MediaType mediaType = 
> detector.detect(stream, metadata);
> MediaType detect(InputStream input, Metadata metadata) throws IOException;



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to